In my Sandbox i have Generated some Apex Classes from WSDL (Synchronous and Asynchronous as default). I have commented out all the async code because i do not use it for the time being, but i don't want to delete it. I have created test class for the synchronous which has 100% coverage.
When i try to deploy to production those 3 Apex Classes (synchronous, synchronousTest,Asyncronous) i get error message for Code Coverage related to the Asynchronous class which is Commented out! Since comments do not count to code coverage why do we get such error message?
Async Class
public class AsyncEa_Covers {
/*public class CallRsTypeFuture extends System.WebServiceCalloutFuture {
public ea_Covers.CallRsType getValue() {
ea_Covers.CallRsType response = (ea_Covers.CallRsType)System.WebServiceCallout.endInvoke(this);
return response;
}
}
public class AsyncCallImplBindingSOAP11QSPort {
public String endpoint_x = '...';
public Map<String,String> inputHttpHeaders_x;
public String clientCertName_x;
public Integer timeout_x;
}*/
}
testclass
@isTest
public class ea_CoversGetControllerTest {
//To achieve code coverage, empty class constructor of async class is declared in this test class
AsyncEa_Covers asyncTest = new AsyncEa_Covers();
//Method to test getCovers method
@isTest public static void getCoversTest() {
try{
//fresh set of Governor Limits
test.startTest();
//...do tests...
test.stopTest();
} catch (Exception e) {
//Exception handling logic...
}
}