I have some end-to-end UI tests with WebDriver that use a remote wiremock instance, that I connect to in the following way:
@Configuration
public class WireMockConfiguration {
@Bean
public WireMock wireMock() {
return new WireMock("my-pyroxy.corp", 8080);
}
}
I have noticed that after tests finish, the wiremock server receives a shutdown request. The Wiremock::shutdown
method is not marked with any annotation like @PreDestroy
but Spring is still invoking it.
How do I stop it (apart from creating this wiremock client bean outside of the spring context?)