Search in sources :

Example 16 with Slf4jNotifier

use of com.github.tomakehurst.wiremock.common.Slf4jNotifier in project spring-cloud-contract by spring-cloud.

the class WireMockProperties method init.

@PostConstruct
public void init() throws IOException {
    if (log.isDebugEnabled()) {
        log.debug("Running initialization of the WireMock configuration");
    }
    if (this.options == null) {
        com.github.tomakehurst.wiremock.core.WireMockConfiguration factory = WireMockSpring.options();
        if (this.wireMock.getServer().getPort() != 8080) {
            factory.port(this.wireMock.getServer().getPort());
        }
        if (this.wireMock.getServer().getHttpsPort() != -1) {
            factory.httpsPort(this.wireMock.getServer().getHttpsPort());
        }
        registerFiles(factory);
        factory.notifier(new Slf4jNotifier(true));
        if (this.wireMock.getPlaceholders().isEnabled()) {
            factory.extensions(new ResponseTemplateTransformer(false));
        }
        this.options = factory;
        if (this.customizers != null) {
            this.customizers.orderedStream().forEach(customizer -> customizer.customize(factory));
        }
    }
    reRegisterServerWithResetMappings();
    reRegisterBeans();
    updateCurrentServer();
}
Also used : ResponseTemplateTransformer(com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer) Slf4jNotifier(com.github.tomakehurst.wiremock.common.Slf4jNotifier) PostConstruct(jakarta.annotation.PostConstruct)

Example 17 with Slf4jNotifier

use of com.github.tomakehurst.wiremock.common.Slf4jNotifier in project bonita-connector-rest by bonitasoft.

the class AcceptanceTestBase method setupServer.

/**
 * The setup of the WireMock server
 */
@BeforeClass
public static void setupServer() {
    wireMockServer = new WireMockServer(WireMockConfiguration.wireMockConfig().port(0).notifier(new Slf4jNotifier(false)));
    wireMockServer.start();
}
Also used : WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) Slf4jNotifier(com.github.tomakehurst.wiremock.common.Slf4jNotifier) BeforeClass(org.junit.BeforeClass)

Aggregations

Slf4jNotifier (com.github.tomakehurst.wiremock.common.Slf4jNotifier)17 WireMockServer (com.github.tomakehurst.wiremock.WireMockServer)15 WireMock (com.github.tomakehurst.wiremock.client.WireMock)10 BeforeMethod (org.testng.annotations.BeforeMethod)10 PostConstruct (javax.annotation.PostConstruct)2 HttpBitbucketServerApiClient (org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient)2 BitbucketServerOAuthAuthenticator (org.eclipse.che.security.oauth1.BitbucketServerOAuthAuthenticator)2 Options (com.github.tomakehurst.wiremock.core.Options)1 WireMockApp (com.github.tomakehurst.wiremock.core.WireMockApp)1 WireMockConfiguration (com.github.tomakehurst.wiremock.core.WireMockConfiguration)1 ResponseTemplateTransformer (com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer)1 AdminRequestHandler (com.github.tomakehurst.wiremock.http.AdminRequestHandler)1 StubRequestHandler (com.github.tomakehurst.wiremock.http.StubRequestHandler)1 ThreadPoolFactory (com.github.tomakehurst.wiremock.http.ThreadPoolFactory)1 QueuedDaemonThreadPool (fr.insee.sugoi.app.service.utils.QueuedDaemonThreadPool)1 PostConstruct (jakarta.annotation.PostConstruct)1 ServletContext (javax.servlet.ServletContext)1 BeforeClass (org.junit.BeforeClass)1 ThreadPool (wiremock.org.eclipse.jetty.util.thread.ThreadPool)1