Polish
This commit is contained in:
@@ -109,17 +109,22 @@ public class WireMockConfiguration implements SmartLifecycle {
|
||||
this.server = new WireMockServer(this.options);
|
||||
}
|
||||
registerStubs();
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("WireMock server has [" + this.server.getStubMappings().size()
|
||||
+ "] stubs registered");
|
||||
}
|
||||
logRegisteredMappings();
|
||||
if (!this.beanFactory.containsBean(WIREMOCK_SERVER_BEAN_NAME)) {
|
||||
this.beanFactory.registerSingleton(WIREMOCK_SERVER_BEAN_NAME, this.server);
|
||||
}
|
||||
}
|
||||
|
||||
private void logRegisteredMappings() {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("WireMock server has [" + this.server.getStubMappings().size()
|
||||
+ "] stubs registered");
|
||||
}
|
||||
}
|
||||
|
||||
void resetMappings() {
|
||||
this.server.resetToDefaultMappings();
|
||||
this.server.resetAll();
|
||||
logRegisteredMappings();
|
||||
}
|
||||
|
||||
private void registerStubs() throws IOException {
|
||||
|
||||
@@ -71,7 +71,7 @@ public final class WireMockTestExecutionListener extends AbstractTestExecutionLi
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug(
|
||||
"Resetting mappings for the next test to restart them. That's necessary when"
|
||||
+ "reusing the same context with new servers running on random ports");
|
||||
+ " reusing the same context with new servers running on random ports");
|
||||
}
|
||||
wireMockConfig(testContext).resetMappings();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.contract: debug
|
||||
com.github.tomakehurst.wiremock: debug
|
||||
|
||||
Reference in New Issue
Block a user