You need to sign in to do that
Don't have an account?
Sudha#a
any one write test class scheduable below code
global class Schedule_SubscriptionCMRRRollup implements Schedulable{
public static String CRON = '0 00 00 * * ?'; //Every Day at Midnight
global static String scheduleMe() {
Schedule_SubscriptionCMRRRollup SC = new Schedule_SubscriptionCMRRRollup();
return System.schedule('Subscription CMRR Rollup Job', CRON, SC);
}
global void execute(SchedulableContext sc) {
Batch_SubscriptionCMRRRollup batch = new Batch_SubscriptionCMRRRollup ();// create Object in Batch class//
Database.executeBatch(batch,50);
}
}
public static String CRON = '0 00 00 * * ?'; //Every Day at Midnight
global static String scheduleMe() {
Schedule_SubscriptionCMRRRollup SC = new Schedule_SubscriptionCMRRRollup();
return System.schedule('Subscription CMRR Rollup Job', CRON, SC);
}
global void execute(SchedulableContext sc) {
Batch_SubscriptionCMRRRollup batch = new Batch_SubscriptionCMRRRollup ();// create Object in Batch class//
Database.executeBatch(batch,50);
}
}
@isTest
private class TestSchedulableClass {
String sch = '0 0 23 * * ?';
Schedule_SubscriptionCMRRRollup scheduleObject = new Schedule_SubscriptionCMRRRollup();
String jobId = System.schedule('Schedule Test', sch, scheduleObject);
1) https://developer.salesforce.com/docs/atlas.en-us.apex_workbook.meta/apex_workbook/apex_scheduling_2.htm
Please try below test class Let us know if this will help you
Thanks
Amit Chaudhary