You need to sign in to do that
Don't have an account?
WSDL-Based Asynchronous Callouts using Continuations can't be unit tested.
The example test case in Making an Asynchronous Callout from an Imported WSDL (https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_continuation_callout_soap.htm) doesn't work in practice.
Attempting to run tests using the pattern defined under Testing WSDL-Based Asynchronous Callouts gives the error:
<span unselectable="on" "="" style="display: block; padding: 3px 4px; overflow: hidden; margin-left: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; white-space: nowrap; background-color: rgb(218, 240, 249);">
Methods defined as TestMethod do not support Web service callouts, test skipped
Attempting to use Test.setMock(WebServiceMock.class, xyz); doesn't work as the respose Map<String, Object> parameter is null. Without populating the mock response you get a GACK:
There is a complete example using a basic WSDL in Asynchronous Callout from an Imported WSDL (http://salesforce.stackexchange.com/q/70259/102)
Attempting to run tests using the pattern defined under Testing WSDL-Based Asynchronous Callouts gives the error:
<span unselectable="on" "="" style="display: block; padding: 3px 4px; overflow: hidden; margin-left: 0px; color: rgb(34, 34, 34); font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: normal; white-space: nowrap; background-color: rgb(218, 240, 249);">
Methods defined as TestMethod do not support Web service callouts, test skipped
Attempting to use Test.setMock(WebServiceMock.class, xyz); doesn't work as the respose Map<String, Object> parameter is null. Without populating the mock response you get a GACK:
Internal Salesforce Error: 104340792-768952 (-1841369010) (-1841369010)
There is a complete example using a basic WSDL in Asynchronous Callout from an Imported WSDL (http://salesforce.stackexchange.com/q/70259/102)
All Answers
Could you please let me know if you are facing this issue on a Summer '15 org or a Spring '15 org?
Hi Shashank,
The org I used to test in on na5, which is currently on Spring 15. After this weekend it will be on Summer 15, so I can test it again then if required.
Thanks,
Daniel
Hi Shashank,
My developer edition org is now on Summer 15. I've confirmed that the problem with testing continuations using web services still exists when running the tests using v34.0 of the API. The getRequests() (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_Continuation.htm#apex_System_Continuation_getRequests) method returns an empty map rather than the expected request.
Attempting to use a WebServiceMock doesn't work as the response parameter is null with doInvoke is called.
Note that I didn't completely rebuild the affected Apex classes against v34.0. I could update the version metadata. However, that still would leave the problem with older Apex classes.
Thanks,
Daniel
Could you please email me at ssrivatsavaya@salesforce.com with the login access and detailed replication steps so that I can investigate on this?
Thanks,
Shashank
any news about this issue.
Also we have problem unit testing Continuation class that make a SOAP request (wsdl).
Do you have any positive feedback/fix/workaround?
BR
Enrico
Enrico, I supplied the details to Shashank via email as requested on the 23rd of June. Haven't heard any more about it. I've given him a nudge on twitter just in case the email got lost.
Failing that, I'll see if I can raise a support case for it directly in a day or so.