I want to understand how priorities work. More specifically, what is the expected output of setting priorities to stub. There's limited documentation on this and the ones available doesn't really explain what the output would look like so I'm unable to verify if I have implemented it correctly.
This is my current code:
stubFor(post(urlMatching("/user/test\\?(and)\\=(que).*")).atPriority(1)
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/plain")
.withBody("This stub is testing for Title ")
)
);
System.out.println("About to execute the second stub");
stubFor(post(urlMatching("/user/test\\?(and)\\=(que).*")).atPriority(2)
.willReturn(aResponse()
.withStatus(200)
.withHeader("Content-Type", "text/plain")
.withBody("This stub is testing Author ID ")
)
);
System.out.println("Second stub executed");
I'm sending the following request from SOAPUI:
/user/test?and=query
Therefore both stubs should be executed and I should receive two responses correct?
I'm currently receiving only one response and that is from the stub that has priority 1. I'm not getting any response from the stub that has priority 2/
Can someone please help me on this?