Im using MockRestServiceServer for mocking http responses. In a specific scenario i call an endpoint two times and want a different response the second time.
But when i write a second expectation it's like it overwrites my first expectation.
How does one write multiple responses for the same request?
I've found it after some research:
When instantiating a MockRestServiceServer it default gets an UnorderedRequestExpectationManager. Changing this via the Builder in a SimpleRequestExpectationManager adds support for adding multiple responses in the order of defining them.