You need to sign in to do that
Don't have an account?
Pedro Garcia 32
Unit test with nested methods
Hi,
I'm creating a Unit Test for a method that calls to another callout method.
I got the following error: Methods defined as TestMethod do not support Web service callouts
I've already created the Unit Test for the callout method and everything works OK.
How could I do it?
cass a{
public mycalloutmethod(url){ return Response.body}
public mymethodfortesting(){
String a = mycalloutmethod('myurl');
do something else
}
}
Thanks,
Pedro
I'm creating a Unit Test for a method that calls to another callout method.
I got the following error: Methods defined as TestMethod do not support Web service callouts
I've already created the Unit Test for the callout method and everything works OK.
How could I do it?
cass a{
public mycalloutmethod(url){ return Response.body}
public mymethodfortesting(){
String a = mycalloutmethod('myurl');
do something else
}
}
Thanks,
Pedro
Here is the detail how to do
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_testing_httpcalloutmock.htm
Please change the response you are expecting.
All Answers
Hi Abdul, please, let me know if this is clearer for you.
Here is the detail how to do
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_testing_httpcalloutmock.htm
Please change the response you are expecting.