New answers tagged


This is weird but I've find out that execute() is executed at the end of a test method, that's why the assertation is failed. Just place System.schedule and Test.stopTest into @TestSetup and It will work.


Launching via the static method - presumably added to make that simple - should help: @isTest static void testScheduleMe() { // Set up any data needed for the code to work Test.startTest(); PBEntryUpdateScheduler.scheduleMe(); Test.stopTest(); // Assert that the results you expect are present }

Top 50 recent answers are included