Forum Discussion

fk's avatar
Occasional Visitor
8 years ago

REST MockService : is it possible to dispatch manually the MockOperation ?



We develop software for lottery terminals and we use a REST MockService to simulate the server responses.


Our problem is that there are some set of transactions between terminal and server which have the same http method and path (these transactions can be distinguished by the Content-Type in the request http header). Therefore we cannot have a MockOperation for each transaction because the automatic dispatch is based on http method and path and it is always the same (first) MockOperation which is selected for a given set.


I know that we could create only one MockOperation for a set of transactions and use script to distinguishe the transaction (by looking at the Content-Type) and select a response. But this is not a confortable usage because we will have to modify the script to select the response we want for a given test.


A more confortable solution would be to have a MockOperation by transaction (so we can select the response we want in the Default Response combo box).


So that is my question : is it possible to bypass the automatic dispatch based on http method and path and select manually the MockOperation we want. Maybe in the OnRequest script of the MockService ?



No RepliesBe the first to reply