You need to sign in to do that
Don't have an account?
ItsJustCode2
As of this morning all web service call outs are not testing out
As of this morning anything that inserts a lead which would also invoke a webservice call out separately in code is erroring out with the following error.
" Methods defined as TestMethod do not support Web service callouts null; Methods defined as TestMethod do not support Web service callouts null"
Here is a sample of one of the web service call outs... Please help.... Kudos given...
" Methods defined as TestMethod do not support Web service callouts null; Methods defined as TestMethod do not support Web service callouts null"
Here is a sample of one of the web service call outs... Please help.... Kudos given...
trigger ImmediateResponseUniversal2 on Lead (after insert) { ID[] ids = new List<ID>(); String url = 'https://cmncom.insidesales.com/do=noauth/immediate_response'; String body; for (Lead l : Trigger.new) { if(l.School__c != 'CMNTest' && l.LeadSource != 'Inbound Call' && l.LeadSource != 'School HST' && l.LeadSource != 'Inbound Call' && l.LeadSource != 'School HST' && l.Status != 'Application' && l.Status != 'Enrolled' && l.Status != 'Started' && l.Status != 'Closed') { ids.add(l.id); } } if (!ids.isEmpty()) { if(trigger.isInsert) { body = 'method=call_now&dialer_initiative_id=67&ids='+EncodingUtil.urlEncode(JSON.serialize(ids), 'ISO-8859-1'); HTTPRequestSender.sendHTTPRequest(url, body); } } }
and class
Please any help you can assist with would be greatly appriciated.
Thanks,
SL
Salesforce does not encourage doing a callout from the test methods.
Instead they have a concept called as the HttpMockCallout class, using which you can write your test methods.
Please go through the below wiki ,
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_testing_httpcalloutmock.htm
PLEASE VOTE FOR THIS ANSWER, IF YOU LIKE IT.
Thanks,
Rohit Alladi