I need to configure multiple expectations on an instance of MockRestServiceServer. The expectations are for two different URLs:
- Call URL #1
- Call URL #1 (for a second time)
- Call URL #2
The same URL is called twice, then a 3rd call is made to the same URL with different request params.
I have one instance of a load-balanced RestTemplate available to inject into my test, and I pass this to MockRestServiceServer.createServer().
I've tried to inline these 3 expectations to my MockRestServiceServer instance but the test fails claiming the 3rd URL was expected but it saw the 1st. It seems like I'm either overwriting the expectations or there's something stateful being shared here that's keeping the mock server in the wrong state.
Can anyone show me an example of how to do this correctly?