1

I'm currently using MockRestServiceServer and I'm running into an issue where there may be later interactions with the mocked server, but the mockServer.expect(ExpectedCount.never(), urlHere) does not wait to see if there are any further interactions.

I was experiencing spillover into other unit tests causing them to fail, and applying @DirtiesContext to the test class like here: https://stackoverflow.com/a/50241367 was able to allow unit tests to pass. However, I'm still seeing in the test class logs that there are interactions with the mock servers after the tests are over.

Is there a way to configure the MockRestServiceServer instance such that it waits for a specified duration for further interactions?

Queue
  • 446
  • 7
  • 23

0 Answers0