I have a batch class which contains HTTP callout, I have seen the blogs for it httpcalloutmock, But I am not understanding how to do it in batch class. Any help is very much appreciated, thank you.
You just need to execute the batchable:
Test.setMock(HttpCalloutMock.class, new YourMock()); // Any data setup goes here Test.startTest(); Database.executeBatch(new YourBatchable()); Test.stopTest();
All asynchronous calls made after the startTest method are collected by the system. When stopTest is executed, all asynchronous processes are run synchronously.