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 

How to cover webservice callout functions in test methods

I have a class which contains functions that are used to make webservice callouts only. I need to cover these functions in my test methods but "Run Test" fails after running the first function with the following message:

Methods defined as TestMethod do not support Web service callouts, test skipped

in this scenario I need to know how I can obtain the required coverage (75%) on my Apex class.  is there anyway that I can ignore callouts but force the test method to continue? in my class more than 75% of the code is the functions that each make a callout to an external webservice. any Idea?

Thanks

Rav_apexRav_apex

Hi BMS

 

I am facing the problem exactly that you are in

did you find a way out or still working

if got pls post here

 

thx

Here-n-nowHere-n-now

You shouldn't have issues to meet the 75% coverage, unless in the generated classes there are a lot of code after the WebServiceCallout.invoke line, which is not usually the case.