Search in sources :

Example 1 with ThreadPoolFactory

use of com.github.tomakehurst.wiremock.http.ThreadPoolFactory in project sugoi-api by InseeFr.

the class WebhookReceiverService method startServer.

public static boolean startServer() {
    WireMockServer webhookServer = new WireMockServer(WireMockConfiguration.wireMockConfig().port(8089).notifier(new Slf4jNotifier(true)).threadPoolFactory(new ThreadPoolFactory() {

        @Override
        public ThreadPool buildThreadPool(Options options) {
            ThreadPool tp = new QueuedDaemonThreadPool(options.containerThreads());
            return tp;
        }
    }));
    webhookServer.start();
    webhookServer.stubFor(post("/spoc/send").willReturn(aResponse().withStatus(200)));
    return true;
}
Also used : Options(com.github.tomakehurst.wiremock.core.Options) ThreadPool(wiremock.org.eclipse.jetty.util.thread.ThreadPool) QueuedDaemonThreadPool(fr.insee.sugoi.app.service.utils.QueuedDaemonThreadPool) ThreadPoolFactory(com.github.tomakehurst.wiremock.http.ThreadPoolFactory) QueuedDaemonThreadPool(fr.insee.sugoi.app.service.utils.QueuedDaemonThreadPool) WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) Slf4jNotifier(com.github.tomakehurst.wiremock.common.Slf4jNotifier)

Aggregations

WireMockServer (com.github.tomakehurst.wiremock.WireMockServer)1 Slf4jNotifier (com.github.tomakehurst.wiremock.common.Slf4jNotifier)1 Options (com.github.tomakehurst.wiremock.core.Options)1 ThreadPoolFactory (com.github.tomakehurst.wiremock.http.ThreadPoolFactory)1 QueuedDaemonThreadPool (fr.insee.sugoi.app.service.utils.QueuedDaemonThreadPool)1 ThreadPool (wiremock.org.eclipse.jetty.util.thread.ThreadPool)1