Forum Discussion

djangofan's avatar
djangofan
Contributor
11 years ago

How do I bind a mock response to a request?

I have created a simple project ( https://github.com/djangofan/soapui-test ) where I have a Mock service with 2 responses defined. When I run a suite with a request on this mock service, the response alternates between the 2 defined mock responses. I don't want it to alternate since my assertion is defined for a particular response. I don't know how to "bind" a certain mock response to a particular request. Can anyone tell me how to do that?

If I run both suites, each with one test case, I get:
    Test1 - gets response 1
Test2 - gets response 2
Result = ok


But, if I run only the second specific test, using Maven '-P' arg, I get:
    Test2 - gets response 1
Result = fail