use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class XmlHandlingAcceptanceTest method init.
@BeforeEach
public void init() {
client = new WireMockTestClient(wm.getPort());
externalDtdServer.stubFor(get("/dodgy.dtd").willReturn(ok("<!ELEMENT shiftydata (#PCDATA)>").withHeader("Content-Type", "application/xml-dtd")));
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class ClientAuthenticationAcceptanceTest method supportsTokenAuthenticatorViaStaticDsl.
@Test
public void supportsTokenAuthenticatorViaStaticDsl() {
final String TOKEN = "my_token_123";
initialise(new TokenAuthenticator(TOKEN), new ClientTokenAuthenticator(TOKEN));
WireMockTestClient client = new WireMockTestClient(server.port());
WireMock.configureFor(goodClient);
// Expect no exception thrown
WireMock.getAllServeEvents();
assertThat(client.get("/__admin/requests").statusCode(), is(401));
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class ClientAuthenticationAcceptanceTest method supportsBasicAuthenticatorViaStaticDsl.
@Test
public void supportsBasicAuthenticatorViaStaticDsl() {
initialise(new BasicAuthenticator(new BasicCredentials("user1", "password1"), new BasicCredentials("user2", "password2")), new ClientBasicAuthenticator("user2", "password2"));
WireMockTestClient client = new WireMockTestClient(server.port());
WireMock.configureFor(goodClient);
// Expect no exception thrown
WireMock.getAllServeEvents();
assertThat(client.get("/__admin/requests").statusCode(), is(401));
}
use of com.github.tomakehurst.wiremock.testsupport.WireMockTestClient in project wiremock by wiremock.
the class WireMockClientAcceptanceTest method init.
@BeforeEach
public void init() {
wireMockServer = new WireMockServer(Options.DYNAMIC_PORT);
wireMockServer.start();
WireMock.configureFor(wireMockServer.port());
testClient = new WireMockTestClient(wireMockServer.port());
}
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());
}
Aggregations