I'm trying to figure out how to test a controller method that does both REST and SOAP callouts in the same transaction. Here is the pseudo code:
HelperClass
public static void restCallout(){
// REST API Callout
}
public static void soapCallout(){
// SOAP API Callout
}
VFP Controller
public void doPageAction(){
// Create some data
insert new Account(Name = 'Test');
// Do the callouts
HelperClass.restCallout();
HelperClass.soapCallout();
HelperClass.restCallout();
}
Now I can easily test both callout methods in the helper class separately by implementing the HttpCalloutMock and WebServiceMock. I've hit a roadblock when trying to test the doPageAction() method as the Test.setMock will only handle either the HttpCalloutMock.class or the WebServiceMock.class.
How can I handle both mock interfaces in the same method?