07 November 2008 - 2.5-beta2 |
soapUI Pro includes a MockResponse step that listens or waits for a SOAP Request and returns a pre configured response before moving on. The incoming request can be validated just as the response of a TestRequest Step with the same configurable assertions.
Usage scenarios for this TestStep are for example:
MockResponse steps can be created either "from scratch" using one of the TestCase or TestStep Insert or Add operations;
The dialog contains the following options:
After setting the desired values and selecting OK, the step will be created and its editor opened.
Other ways to create a MockResponse Step are:
The MockResponse Step is the basically the same as the standard soapUI Pro MockResponse editor with the addition of the same assertions/log tabs in the bottom as the TestRequest editor and a number of context-sensitive wizards in the Outline Editor for creating assertions and Property Transfers.
At the top there is a toolbar that adds input fields for the path and port to listen on during execution, the rest is the same as the MockResponse editor. These are grayed out during execution of the MockResponse step. Assertions can be added/managed just as for the TestRequest editor, the list of available assertions is the same except the SOAP-Fault-related assertions, which are not applicable to request messages.
When the execution of a TestCase reaches a MockResponse Step, the step will start a local temporary MockService and wait for a request to the configured operation on the configured path and port. Once a request has been received, it will be validated with the configured assertions and processed just like a standard MockResponse. After returning the MockResponse result, the MockService will be closed down. and execution will move to the next step in the TestCase.
Property Transfers can be used with MockResponse Steps just as with TestRequests, i.e. properties can be transferred from incoming requests and to outgoing responses.
Although running a LoadTest containing MockResponse steps will work, these steps are not designed for LoadTesting due to the following:
The context script variable available in the MockResponse Response Script, acts both as a MockRunContext and a TestRunContext, allowing it to access the same context variables as other Groovy scripts in the TestCase