GWY
2022-05-21 a3460549533111815e7f73d6cef601a58031525d
1
2
3
4
5
6
7
8
9
10
11
12
13
@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);
 
    }
}