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

Test class for an Asynchronous class imported by a WSDL(SOAP)

Hi, Here is my Asynchronous class imported by a WSDL. Can anyone tell me how to write a test class for this class. Also I want to know how to deal with 'System.Continuation continuation' . Thanks in advance.

public class AsyncOntrackworkflowComWebservicesAuth {
    public class LoginResponse_elementFuture extends System.WebServiceCalloutFuture {
        public String getValue() {
            ontrackworkflowComWebservicesAuth.LoginResponse_element response = (ontrackworkflowComWebservicesAuth.LoginResponse_element)System.WebServiceCallout.endInvoke(this);
            if(!Test.isRunningTest()) {
            return response.LoginResult;
            else {
            return 'Success';
    public class AsyncOTWSAuthenticationServiceSoap {
        public String endpoint_x = '';
        public Map<String,String> inputHttpHeaders_x;
        public String clientCertName_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'', 'ontrackworkflowComWebservicesAuth'}; 
        public AsyncOntrackworkflowComWebservicesAuth.LoginResponse_elementFuture beginLogin(System.Continuation continuation,String logonName,String logonPassword) {
            ontrackworkflowComWebservicesAuth.Login_element request_x = new ontrackworkflowComWebservicesAuth.Login_element();
            request_x.logonName = logonName;
            request_x.logonPassword = logonPassword;
    return (AsyncOntrackworkflowComWebservicesAuth.LoginResponse_elementFuture) System.WebServiceCallout.beginInvoke(this,request_x,AsyncOntrackworkflowComWebservicesAuth.LoginResponse_elementFuture.class,continuation,new String[]{endpoint_x,'','','Login','','LoginResponse','ontrackworkflowComWebservicesAuth.LoginResponse_element'});
Best Answer chosen by sruthi26
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for same

You need to create mock callout for same