we are using a standalone WireMock to verify HTTP requests in our tests. In order to isolate the test cases, we need to reset the request journal before each test case. But since we are running the tests in parallel (using Gradle maxParallelForks), resetting the whole journal is not an option.
Do you have any suggestion how to handle this use case?
So far we have come up with these idea: Add possibility to remove only matching requests. That way we could workaround the problem by removing only requests expected by the current test.
This could be achieved in two ways:
- Extend WireMock core
- add new method to RequestJournal interface: void resetRequestsMatching(RequestPattern requestPattern);
- add corresponding Admin API
- Add Admin Extension
- as far I can see, this would require quite some reflection hacks, since there is no Admin API
If you think that this is a reasonable feature, we are happy to work on it and submit a PR.