Tal Kaptsan
06/06/2024, 11:02 AMprotected static WireMockServer wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().dynamicPort());
@BeforeAll
public static void startWireMock() {
wireMockServer.start();
}
@AfterAll
public static void stopWireMock() {
wireMockServer.stop();
}
Then, in my test, I extend the base class and, in the beforeEach
stage, I configure the stubs like this:
wireMockServer.stubFor(<http://WireMock.post|WireMock.post>(WireMock.urlPathEqualTo("/dummySuccess"))
.willReturn(aResponse()
.withStatus(200)));
In the first test case, everything works as expected. However, in the subsequent test cases, WireMock just hangs, and the tests fail due to a timeout that I’ve configured. I’m using wiremock-standalone v3.6.0 in my pom.xml file
Is there any workaround to this? (I’ve tried calling wireMockServer.resetAll(); with no success)
Thanks!Bas Dijkstra
06/06/2024, 11:53 AMBas Dijkstra
06/06/2024, 11:54 AMTal Kaptsan
06/06/2024, 12:12 PMBas Dijkstra
06/06/2024, 12:18 PM@BeforeAll
method just to see if that works?