use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class StubRequestLoggingAcceptanceTest method logsEventsToNotifierWhenNotDisabled.
@Test
public void logsEventsToNotifierWhenNotDisabled() {
TestNotifier notifier = new TestNotifier();
WireMockServer wm = new WireMockServer(wireMockConfig().dynamicPort().notifier(notifier));
wm.start();
testClient = new WireMockTestClient(wm.port());
wm.stubFor(get("/log-me").willReturn(ok("body text")));
testClient.get("/log-me");
assertThat(notifier.infoMessages.size(), is(1));
assertThat(notifier.infoMessages.get(0), allOf(containsString("Request received:"), containsString("/log-me"), containsString("body text")));
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class MappingsLoaderAcceptanceTest method buildWireMock.
private void buildWireMock(Options options) {
wireMockServer = new WireMockServer(options);
wireMockServer.start();
testClient = new WireMockTestClient(wireMockServer.port());
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class MultithreadConfigurationInheritanceTest method setup.
@BeforeAll
public static void setup() {
wireMockServer = new WireMockServer(0);
wireMockServer.start();
WireMock.configureFor(wireMockServer.port());
client = new WireMockTestClient(wireMockServer.port());
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class RecordingDslAcceptanceTest method init.
@BeforeEach
public void init() {
fileRoot = setupTempFileRoot();
proxyingService = new WireMockServer(wireMockConfig().dynamicPort().withRootDirectory(fileRoot.getAbsolutePath()));
proxyingService.start();
targetService = wireMockServer;
targetBaseUrl = "http://localhost:" + targetService.port();
client = new WireMockTestClient(proxyingService.port());
WireMock.configureFor(proxyingService.port());
adminClient = WireMock.create().port(proxyingService.port()).build();
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class ResponseDefinitionTransformerAcceptanceTest method startWithExtensions.
private void startWithExtensions(String... extensions) {
wm = new WireMockServer(wireMockConfig().dynamicPort().withRootDirectory(defaultTestFilesRoot()).extensions(extensions));
wm.start();
client = new WireMockTestClient(wm.port());
}
Aggregations