use of com.hotels.styx.server.HttpConnectorConfig in project styx by ExpediaGroup.
the class MockOriginServerTest method configuresEndpoints.
@Test
public void configuresEndpoints() {
server = MockOriginServer.create("", "", 0, new HttpConnectorConfig(0)).start().stub(WireMock.get(urlMatching("/.*")), aResponse().withStatus(200).withHeader("a", "b").withBody("Hello, World!"));
HttpResponse response = await(client.sendRequest(get(format("http://localhost:%d/mock", server.port())).header("X-Forwarded-Proto", "http").build()));
assertThat(response.status(), is(OK));
assertThat(response.header("a"), is(Optional.of("b")));
assertThat(response.bodyAs(UTF_8), is("Hello, World!"));
server.verify(getRequestedFor(urlEqualTo("/mock")).withHeader("X-Forwarded-Proto", valueMatchingStrategy("http")));
}
use of com.hotels.styx.server.HttpConnectorConfig in project styx by ExpediaGroup.
the class StyxServerTest method styxConfig.
private static StyxConfig styxConfig() {
ProxyServerConfig proxyConfig = new ProxyServerConfig.Builder().setHttpConnector(new HttpConnectorConfig(0)).build();
AdminServerConfig adminConfig = new AdminServerConfig.Builder().setHttpConnector(new HttpConnectorConfig(0)).build();
Configuration config = new MapBackedConfiguration(EMPTY_CONFIGURATION).set("admin", adminConfig).set("proxy", proxyConfig);
return new StyxConfig(config);
}
Aggregations