Search in sources :

Example 41 with WireMockTestClient

use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.

the class PostServeActionExtensionTest method initWithOptions.

void initWithOptions(Options options) {
    wm = new WireMockServer(options);
    wm.start();
    client = new WireMockTestClient(wm.port());
}
Also used : WireMockTestClient(com.github.tomakehurst.wiremock.testsupport.WireMockTestClient)

Example 42 with WireMockTestClient

use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.

the class StubMappingPersistenceAcceptanceTest method init.

@BeforeEach
public void init() throws Exception {
    rootDir = Files.createTempDirectory("temp-filesource");
    mappingsDir = rootDir.resolve("mappings");
    FileSource fileSource = new SingleRootFileSource(rootDir.toAbsolutePath().toString());
    fileSource.createIfNecessary();
    FileSource filesFileSource = fileSource.child(FILES_ROOT);
    filesFileSource.createIfNecessary();
    FileSource mappingsFileSource = fileSource.child(MAPPINGS_ROOT);
    mappingsFileSource.createIfNecessary();
    wireMockServer = new WireMockServer(wireMockConfig().fileSource(fileSource).dynamicPort());
    wireMockServer.start();
    testClient = new WireMockTestClient(wireMockServer.port());
    WireMock.configureFor(wireMockServer.port());
    wm = wireMockServer;
}
Also used : WireMockTestClient(com.github.tomakehurst.wiremock.testsupport.WireMockTestClient) FileSource(com.github.tomakehurst.wiremock.common.FileSource) SingleRootFileSource(com.github.tomakehurst.wiremock.common.SingleRootFileSource) SingleRootFileSource(com.github.tomakehurst.wiremock.common.SingleRootFileSource) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 43 with WireMockTestClient

use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.

the class WireMockClientWithProxyAcceptanceTest method init.

@BeforeAll
public static void init() {
    wireMockServer = new WireMockServer(DYNAMIC_PORT);
    wireMockServer.start();
    proxyServer = DefaultHttpProxyServer.bootstrap().withPort(0).start();
    testClient = new WireMockTestClient(wireMockServer.port());
}
Also used : WireMockTestClient(com.github.tomakehurst.wiremock.testsupport.WireMockTestClient) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

WireMockTestClient (com.github.tomakehurst.wiremock.testsupport.WireMockTestClient)43 Test (org.junit.jupiter.api.Test)16 BeforeEach (org.junit.jupiter.api.BeforeEach)10 WireMockResponse (com.github.tomakehurst.wiremock.testsupport.WireMockResponse)9 WireMockServer (com.github.tomakehurst.wiremock.WireMockServer)3 Matchers.containsString (org.hamcrest.Matchers.containsString)3 BeforeAll (org.junit.jupiter.api.BeforeAll)3 SingleRootFileSource (com.github.tomakehurst.wiremock.common.SingleRootFileSource)2 WebAppContext (org.eclipse.jetty.webapp.WebAppContext)2 FileSource (com.github.tomakehurst.wiremock.common.FileSource)1 ProxySettings (com.github.tomakehurst.wiremock.common.ProxySettings)1 Request (com.github.tomakehurst.wiremock.http.Request)1 X509KeyStore (com.github.tomakehurst.wiremock.http.ssl.X509KeyStore)1 WireMockServerRunner (com.github.tomakehurst.wiremock.standalone.WireMockServerRunner)1 Stopwatch (com.google.common.base.Stopwatch)1 Certificate (java.security.cert.Certificate)1 Collections.singletonList (java.util.Collections.singletonList)1 List (java.util.List)1 ExecutorService (java.util.concurrent.ExecutorService)1 Future (java.util.concurrent.Future)1