use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class ResponseDelayAcceptanceTest method init.
@BeforeEach
public void init() {
httpClient = HttpClientFactory.createClient(SOCKET_TIMEOUT_MILLISECONDS);
testClient = new WireMockTestClient(wireMockRule.getPort());
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class BindAddressTest method executeGetIn.
private void executeGetIn(String address) {
WireMockTestClient wireMockClient = new WireMockTestClient(wireMockServer.port(), address);
WireMockResponse response = wireMockClient.get("/bind-test");
assertThat(response.statusCode(), is(200));
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class BrowserProxyAcceptanceTest method init.
@BeforeEach
public void init() {
testClient = new WireMockTestClient(target.getPort());
proxy = new WireMockServer(wireMockConfig().dynamicPort().enableBrowserProxying(true));
proxy.start();
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class ConcurrentProxyingTest method concurrent.
@Test
public void concurrent() throws Exception {
client = new WireMockTestClient(wm.getPort());
wm.stubFor(any(anyUrl()).atPriority(10).willReturn(aResponse().proxiedFrom(target.baseUrl())));
ExecutorService executor = Executors.newFixedThreadPool(20);
List<Future<?>> results = newArrayList();
for (int i = 0; i < 100; i++) {
results.add(executor.submit(new Runnable() {
@Override
public void run() {
assertThat(client.get("/plain-example1.txt").content(), is("Example 1"));
assertThat(client.get("/plain-example2.txt").content(), is("Example 2"));
assertThat(client.get("/plain-example3.txt").content(), is("Example 3"));
assertThat(client.get("/plain-example4.txt").content(), is("Example 4"));
assertThat(client.get("/plain-example5.txt").content(), is("Example 5"));
}
}));
}
for (Future<?> result : results) {
result.get();
}
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class CustomMatchingAcceptanceTest method init.
@BeforeEach
public void init() {
client = new WireMockTestClient(wmRule.getPort());
wm = WireMock.create().port(wmRule.getPort()).build();
}
Aggregations