You need to sign in to do that
Don't have an account?
Steve MunLeeuw 15
Undelete unit test on contact with Cloudingo installed fails with 'Methods defined as TestMethod do not support Web service callouts'
I have a unit test that covers the undelete of contacts, but it is failing with the message: 'Methods defined as TestMethod do not support Web service callouts'
I believe this is because the installed Cloudingo package also has a trigger on the contact object named ContactUpdatePOSyncTrigger. There is also a connected app for this package. The failure doesn't occur until Test.stopTest() is called so it's difficult to narrow it down further. Is there a way to disable a managed package while running unit tests? I don't believe I can mock this service callout since it's in a mananged package, and really I have no insight into what the method signature is.
Thanks,
Steve MunLeeuw
I believe this is because the installed Cloudingo package also has a trigger on the contact object named ContactUpdatePOSyncTrigger. There is also a connected app for this package. The failure doesn't occur until Test.stopTest() is called so it's difficult to narrow it down further. Is there a way to disable a managed package while running unit tests? I don't believe I can mock this service callout since it's in a mananged package, and really I have no insight into what the method signature is.
Thanks,
Steve MunLeeuw
Please tag as best answer if it helps resolve the issue.
Regards,
All Answers
Please tag as best answer if it helps resolve the issue.
Regards,
I think in your class you are using Http classes .To cover Http classes you need to implement HttpCalloutMock Interface.
Please check once below link for more info :
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_testing_httpcalloutmock.htm
https://developer.salesforce.com/blogs/developer-relations/2013/03/testing-apex-callouts-using-httpcalloutmock.html
https://developer.salesforce.com/forums/ForumsMain?id=9060G000000UWOQQA4
Otherwise please share your code.
Let us know it helps you, and kindly close your query by choosing best answer if you got your answer.
Thanks
Varaprasad