You need to sign in to do that
Don't have an account?
Chris Pulliam
Any help is greatly appreciated. Thanks.
APEX Test Class Error "Methods defined as TestMethod do not support Web service callouts" Opportunity
@isTest public class AccRelatedContTest { static testmethod void updateOpp() { Account testAccount = new Account(); testAccount.Name='Test Account' ; testAccount.OwnerID = '005d0000003Xjjh'; testAccount.Website = 'hopethisworks.com'; testAccount.recordtypeid = '012d0000000PBVJ'; insert testAccount; Contact cont = new Contact(); cont.FirstName='Test'; cont.LastName='Test'; cont.Accountid= testAccount.id; insert cont; Opportunity o = new Opportunity( Name='Test Opp', NextStep = 'Testing', Accountid= testAccount.id, StageName = 'Prospect', Probability=100, CloseDate = date.today(), RecordTypeid = '012d0000000PDkW'); insert o; } }This is the test class code attempting to provide code coverage for an opportunity create and update trigger. When I run it without the opportunity part it passes fine, but when I include it gives a "Methods defined as TestMethod do not support Web service callouts" error, which is frustrating because I'm not making any Web service callouts (I think?!)
Any help is greatly appreciated. Thanks.
http://salesforce.stackexchange.com/questions/3486/testing-httpcallout-with-httpcalloutmock-and-unittest-created-data
All Answers
http://salesforce.stackexchange.com/questions/3486/testing-httpcallout-with-httpcalloutmock-and-unittest-created-data
I think you are right that it's triggering some callout from a related package. It won't let me uninstall the packages from the sandbox environment.
Can you please advice how to write the test class to skip the callouts? I'm having trouble following the link you sent.