1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| @isTest
| private class CreateOpportunityTaskBatchScheduleTest {
| static testMethod void testMethod1() {
| // 这还能写死的?
| // String CRON_EXP = '0 0 0 3 9 ? 2022';
| Date testday = Date.today().addDays(1);
| String CRON_EXP = '0 0 0 ' + testday.day() + ' ' + testday.month() + ' ? ' + testday.year();
|
| System.Test.startTest();
| // Schedule the test job
| system.schedule('CreateOpportunityTaskBatch', CRON_EXP, new CreateOpportunityTaskBatchSchedule());
| // System.assertEquals('2022-09-03 00:00:00', String.valueOf(ct.NextFireTime));
| System.Test.StopTest();
| }
|
| }
|
|