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
Bms270Bms270 

Testmethods do not support webservice callouts.

Hi,

 

When I run my test method I get the following exception:

 

System.TypeException: Testmethods do not support webservice callouts.

 

this happens at the line that my code calls a webservice and from that point the test method doesnt cover any lines of code (even those lines that has nothing to do with webservices). Is there any workaround for this? I cant increase the coverage just because of this issue.

 

 

Any Idea?

 

Thanks.

Ron HessRon Hess

What API verision is your Apex Class ?

in the newer versions I believe that your callout will return null and execution will continue.

Bms270Bms270

Hi Ron,

 

I am using the latest API (15) and I still get this exception. not sure what to do. is there any annotation or something I have to put for test method to work? 

 

Thanks for your help.