You need to sign in to do that
Don't have an account?
Sarabjeet 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?
May I suggest you please refer the below link for reference.
- https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_testing_httpcalloutmock.htm
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
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