use of com.hotels.styx.api.HttpResponse in project styx by ExpediaGroup.
the class StyxServerTest method startsAdminOnSpecifiedHttpPort.
@Test
public void startsAdminOnSpecifiedHttpPort() {
styxServer = new StyxServer.Builder().adminHttpPort(0).addRoute("/", originServer1.port()).start();
HttpResponse response = await(client.sendRequest(get(format("https://localhost:%d/admin", styxServer.adminPort())).build()));
assertThat(response.status(), is(OK));
}
use of com.hotels.styx.api.HttpResponse in project styx by ExpediaGroup.
the class StyxServerTest method proxiesToOriginViaHttpsWithRequestOriginallyHttp.
@Test
public void proxiesToOriginViaHttpsWithRequestOriginallyHttp() {
BackendService backendService = new BackendService().ssl().addOrigin(secureOriginServer.httpsPort());
styxServer = new StyxServer.Builder().addRoute("/", backendService).start();
HttpResponse response = await(client.sendRequest(get(format("http://localhost:%d/", styxServer.proxyHttpPort())).build()));
assertThat(response.status(), is(OK));
configureFor(secureOriginServer.port());
WireMock.verify(getRequestedFor(urlPathEqualTo("/")));
}
use of com.hotels.styx.api.HttpResponse in project styx by ExpediaGroup.
the class StyxServerTest method addsPluginsLinkToAdminIndex.
@Test
public void addsPluginsLinkToAdminIndex() {
styxServer = new StyxServer.Builder().addRoute("/", originServer1.port()).start();
HttpResponse response = doAdminRequest("/");
assertThat(response.status(), is(OK));
assertThat(response.bodyAs(UTF_8), containsString("/admin/plugins"));
}
use of com.hotels.styx.api.HttpResponse in project styx by ExpediaGroup.
the class StyxServerTest method startsProxyOnSpecifiedHttpPort.
@Test
public void startsProxyOnSpecifiedHttpPort() {
styxServer = new StyxServer.Builder().proxyHttpPort(0).addRoute("/", originServer1.port()).start();
HttpResponse response = await(client.sendRequest(get(format("https://localhost:%d/", styxServer.proxyHttpPort())).build()));
assertThat(response.status(), is(OK));
}
use of com.hotels.styx.api.HttpResponse in project styx by ExpediaGroup.
the class StyxServerTest method addsPluginLinkToPluginsIndex.
@Test
public void addsPluginLinkToPluginsIndex() {
setUpStyxAndPlugins("plugin-foo", "plugin-bar", "plugin-baz");
HttpResponse response = doAdminRequest("/admin/plugins");
assertThat(response.status(), is(OK));
assertThat(response.bodyAs(UTF_8), allOf(containsString("/admin/plugins/plugin-foo"), containsString("/admin/plugins/plugin-bar"), containsString("/admin/plugins/plugin-baz")));
}
Aggregations