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
Ravi kumar 292Ravi kumar 292 

How to cover the Json Parsing in Test Class

Hi, 

I want to cover the json parsing in test class. how to do this.. based on the json response i am calling another method. So problem here is, am unable to cover the json parsing.

below is my screen shot.

User-added image
Sujit Anil NirkheSujit Anil Nirkhe

Hi Ravi,

To get this covered you can use Mock Responses in test class. For more ref : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_testing_httpcalloutmock.htm