You need to sign in to do that
Don't have an account?
Chidanand M
FATAL_ERROR|System.TypeException: Methods defined as TestMethod do not support Web service callouts, test skipped
Hi friends,
I have written a test class for my trigger in account object.
But whever i run the test class, i am getting the fowwing error
FATAL_ERROR|System.TypeException: Methods defined as TestMethod do not support Web service callouts, test skipped.
I have some of the managed packages inside the Account object.
The same test class when i run before refreshing my sandbox it was working fine. But the problem started after refreshing the sandbox. But other object testclasses r running correctly.
Here is my complete error message
00:25:27.648 (3648848170)|CODE_UNIT_FINISHED|territoryownerTest.checkStateCountry 00:25:27.650 (3650894509)|EXECUTION_FINISHED 00:25:27.654 (3654729375)|ENTERING_MANAGED_PKG|ClientSuccess 00:25:27.655 (3655562162)|FATAL_ERROR|System.TypeException: Methods defined as TestMethod do not support Web service callouts, test skipped (ClientSuccess) 00:25:27.655 (3655576096)|FATAL_ERROR|System.TypeException: Methods defined as TestMethod do not support Web service callouts, test skipped (ClientSuccess)
Can anyone tell me how to resolve this issue.
I have written a test class for my trigger in account object.
But whever i run the test class, i am getting the fowwing error
FATAL_ERROR|System.TypeException: Methods defined as TestMethod do not support Web service callouts, test skipped.
I have some of the managed packages inside the Account object.
The same test class when i run before refreshing my sandbox it was working fine. But the problem started after refreshing the sandbox. But other object testclasses r running correctly.
Here is my complete error message
00:25:27.648 (3648848170)|CODE_UNIT_FINISHED|territoryownerTest.checkStateCountry 00:25:27.650 (3650894509)|EXECUTION_FINISHED 00:25:27.654 (3654729375)|ENTERING_MANAGED_PKG|ClientSuccess 00:25:27.655 (3655562162)|FATAL_ERROR|System.TypeException: Methods defined as TestMethod do not support Web service callouts, test skipped (ClientSuccess) 00:25:27.655 (3655576096)|FATAL_ERROR|System.TypeException: Methods defined as TestMethod do not support Web service callouts, test skipped (ClientSuccess)
Can anyone tell me how to resolve this issue.
You have to make a mock callout in your test class to avoid that problem
Check this link to know more about Testing Webservice Callout (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_wsdl2apex_testing.htm) in apex
Could u plz tell me where do i need to add it in my test class.
Here is my test class. TIA
Even after adding setMock() method also, m getting the same error.
I just followed the link that u sent and created an interface and class.
But still the issue is not unsolved