@isTest
|
private class LogAutoSendScheduleTest {
|
|
@isTest static void test_assignOneMinute() {
|
Datetime addOneM = System.now().addMinutes(2);
|
String CRON_EXP = '0 ' + addOneM.minute() + ' ' + addOneM.hour() + ' ' + addOneM.day() + ' ' + addOneM.month() + ' ? ' + addOneM.year();
|
LogAutoSendSchedule.assignOneMinute();
|
CronTrigger oldcron = [select Id, CronJobDetail.Name from CronTrigger where CronExpression = :CRON_EXP and CronJobDetail.Name like 'LogAutoSendSBG%'];
|
// Verify the next time the job will run
|
System.assertEquals('LogAutoSendSBG' + CRON_EXP, oldcron.CronJobDetail.Name);
|
|
}
|
}
|