Hello all, I'm trying to write tests for an interoperability production using %UnitTest.TestProduction. I'd like to control the behavior of the SOAP operations so they don't actually connect to external systems when I'm testing. My first thought for this is to create a mock outbound adapter class that answers with some configured class method:
Class UnitTest.Helper.Integration.MockSoapAdapter Extends EnsLib.SOAP.OutboundAdapter
{
Property MockAdapterAnswerClass As %String;
Property MockAdapterAnswerMethod As %String;
Parameter SETTINGS = "MockAdapterAnswerClass,MockAdapterAnswerMethod";
Method InvokeMethod(pMethodName As %String, Output pResult As %RegisteredObject, pArgs...) As %Status
{
return $classmethod(..MockAdapterAnswerClass, ..MockAdapterAnswerMethod, pMethodName, .pResult, pArgs...)
}
}
.png)
.png)

