function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bvdbbvdb 

Testing Batch Code

Hi,

 

I'm trying to test a batch class with the following code:

 

        InventoryJournalUtil util = new InventoryJournalUtil(idList,'Adjustment');
        ID batchprocessId = Database.executeBatch(util);
        System.debug('Batch process id:' + batchprocessId);    

 

InventoryJournalUtil is the class that implements Database.Batchable. I initialize a new instance of it and run Database.executeBatch on it. It returns a batch process id and everything but the code coverage never reaches outside of the constructor. How do I get to the code in the start, execute, and finish methods?

Anand@SAASAnand@SAAS
Look at the documentation here.