Sets a defaultInstance for WireMock server

without this change we're not resetting default instances upon test finish
with this change we're resetting the default intance and setting it once more upon configuration startup

fixes gh-1081
This commit is contained in:
Marcin Grzejszczak
2019-08-05 21:32:15 +02:00
parent dbb1af8d98
commit 4f652ad1e6

View File

@@ -119,6 +119,9 @@ public class WireMockConfiguration implements SmartLifecycle {
if (!this.beanFactory.containsBean(WIREMOCK_SERVER_BEAN_NAME)) {
this.beanFactory.registerSingleton(WIREMOCK_SERVER_BEAN_NAME, this.server);
}
if (isRunning()) {
updateCurrentServer();
}
}
private void logRegisteredMappings() {
@@ -130,6 +133,7 @@ public class WireMockConfiguration implements SmartLifecycle {
void resetMappings() {
this.server.resetAll();
WireMock.reset();
logRegisteredMappings();
}