8. Test Scheduling Logic | Apex Specialist Superbadge | ApexSalesforceTutorials.com
ฝัง
- เผยแพร่เมื่อ 29 ก.พ. 2024
- #salesforce #trailhead #codding #superbadge
Please find the code in the comment.
8th Part Of Apex Specialist Superbadge
Solution of Test Scheduling Logic of Apex Specialist Superbadge.
You can ask for solution of any trailhead in the comment section.
Please do Like, Subscribe, Comment, & Share with your fellow mates.
The content is for educational purposes and guidance for programmers.
************************* WarehouseSyncSchedule *****************
global class WarehouseSyncSchedule implements Schedulable {
global void execute(SchedulableContext ctx) {
WarehouseCalloutService.runWarehouseEquipmentSync();
}
}
*************************** WarehouseSyncScheduleTest ******************
@isTest
public class WarehouseSyncScheduleTest {
@isTest static void WarehousescheduleTest(){
String scheduleTime = '00 00 01 * * ?';
Test.startTest();
Test.setMock(HttpCalloutMock.class, new WarehouseCalloutServiceMock());
String jobID=System.schedule('Warehouse Time To Schedule to Test', scheduleTime, new WarehouseSyncSchedule());
Test.stopTest();
//Contains schedule information for a scheduled job. CronTrigger is similar to a cron job on UNIX systems.
// This object is available in API version 17.0 and later.
CronTrigger a=[SELECT Id FROM CronTrigger where NextFireTime > today];
System.assertEquals(jobID, a.Id,'Schedule ');
}
}
Great
thanks
Nice videos
Glad you like them!
Nice, thanks
thanks
Thanks for uploading
My pleasure