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
bouscalbouscal 

Test methods do not support web service callouts, but they don't have any.

I have the following test class, created by a 3rd party, that is causing issues when I attempt to edit other Apex or deploy new.  What is causing the error?
 
@isTest
private class TestAddAgreementEventToChatterFeed
{
    private static testMethod void myTest()
    {
        Contact objContact = new Contact();
        objContact.LastName = 'Test';
        List<echosign_dev1__SIGN_AgreementEvent__c > lstAE = new List<echosign_dev1__SIGN_AgreementEvent__c> ();
        insert objContact;
    
        echosign_dev1__SIGN_Agreement__c objA1 = new echosign_dev1__SIGN_Agreement__c();
        objA1.echosign_dev1__Recipient__c = objContact.Id;
        objA1.Name = 'Test Agreement 1';
        insert objA1;
        
        echosign_dev1__SIGN_Agreement__c objA2 = new echosign_dev1__SIGN_Agreement__c();
        objA2.echosign_dev1__Recipient__c = objContact.Id;
        objA2.Name = 'Test Agreement 2';
        insert objA2;
    
        echosign_dev1__SIGN_Agreement__c objA3 = new echosign_dev1__SIGN_Agreement__c();
        objA3.echosign_dev1__Recipient__c = objContact.Id;
        objA3.Name = 'Test Agreement 3';
        insert objA3;
        
        echosign_dev1__SIGN_AgreementEvent__c objAE1 = new echosign_dev1__SIGN_AgreementEvent__c();
        objAE1.echosign_dev1__SIGN_Agreement__c = objA1.Id;
        lstAE.add(objAE1);
        
        echosign_dev1__SIGN_AgreementEvent__c objAE2 = new echosign_dev1__SIGN_AgreementEvent__c();
        objAE2.echosign_dev1__SIGN_Agreement__c = objA2.Id;
        objAE2.echosign_dev1__Description__c= 'signed';
        lstAE.add(objAE2);
        
        echosign_dev1__SIGN_AgreementEvent__c objAE3 = new echosign_dev1__SIGN_AgreementEvent__c();
        objAE3.echosign_dev1__SIGN_Agreement__c = objA3.Id;
        objAE3.echosign_dev1__Description__c= 'sent out';
        lstAE.add(objAE3);
    
        insert lstAE;
        
    }
}

 
@Karanraj@Karanraj
Seems like you are making webservice callout in the following objects trigger code Contact or echosign_dev1__SIGN_Agreement__c.
Once the test data is created in the system, it will call workflow rule, apextrigger and other process in the system as part of the excution flow. By default, test methods don’t support web service callouts, and tests that perform web service callouts fail. To prevent tests from failing and to increase code coverage, Apex provides the built-in WebServiceMock interface and theTest.setMock method. Use WebServiceMock and Test.setMock to receive fake responses in a test method.

Check this link for more details - https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_wsdl2apex_testing.htm
Hassan AnwarHassan Anwar
Hi there,
Any solution for the above problem as it occurs due to Agreement Event object (Adobe Sign managed package) webservice callout?