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
Sarabjeet Pal 24Sarabjeet Pal 24 

Hi All I am writing a Unit Test for a Integration code, what I need to know is how can I pass different response for same GET,PUT method ?

Hi All I am writing a Unit Test for a Integration code, what I need to know is how can I pass different response for same GET,PUT method ?  I am doing a Mock Callout but there I am passing only 1 response per http method but I need to be more dynamic to pass different response for GET,PUT based on what method I call so that I can cover more code? Is there a way?
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Sarabjeet,

May I suggest you please refer the below link for reference. Hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar
Sarabjeet Pal 24Sarabjeet Pal 24
Hi Rahul

Thanks for your suggestion- I read it earlier but that can give 1 response for each http Method, but I am looking for different response say for same type of http Method. As in my Code we do multiple http callout each expecting different response and based on it we call different methods.So I am looking for a way where I can dynamically change the response instead of hard coding it.

Thanks

Regards
Sarabjeet Pal