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
astroastro 

How to test a static webservice class

I have a webservice class which invokes a visualforce page which calls the underlying controller and I am trying to write a test  class for all 3 (the webservice, visualforce page and it's controller).

 

I have a test method in my webservice class which calls another class in which I have a single method in which I setup all data and then call my webservice class to test it.  This class is called mass_emails_test_ff.cls

 

For some reason only the class mass_emails_test_ff.cls is covered and NONE of the actual class I want to test is being covered.  

 

in mass_emails_test_ff.cls I call my webservice as follows: myWebservice.method(argument);

 

I'm not exactly sure why only my 1 class which is used to setup data is covered and nothing else.  Even though I do call the class I intend to test, it still does not get covered.

 

Any help would be appreciated. 

Best Answer chosen by Admin (Salesforce Developers) 
astroastro

figured it out.   I poured through all the debugs and found  that there was an error being caught before it even got to go into the webservice class :)