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
Som_11Som_11 

How to write a test class for future post callout

Hi all, How to write a test class method for future post callout.
I have the code attached in picture.
Can any one give example please.User-added image

 
AnudeepAnudeep (Salesforce Developers) 
Hi Somesh, 

As you already know Apex test methods don’t support callouts, and tests that perform callouts fail. However, testing runtime allows you to “mock” the callout. Mock callouts allow you to specify the response to return in the test instead of actually calling the web service

I recommend looking at the example listed in this Trailhead Module. If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank You!

Anudeep