use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class HttpListConfigsHandlerTest method require_that_handler_can_be_created.
@Test
public void require_that_handler_can_be_created() throws IOException {
HttpResponse response = handler.handle(HttpRequest.createTestRequest("/config/v1/", GET));
assertThat(SessionHandlerTest.getRenderedString(response), is("{\"children\":[],\"configs\":[]}"));
}
use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class HttpListConfigsHandlerTest method require_that_named_handler_can_be_created.
@Test
public void require_that_named_handler_can_be_created() throws IOException {
HttpRequest req = HttpRequest.createTestRequest("http://foo.com:8080/config/v1/foo.bar/conf/id/", GET);
req.getJDiscRequest().parameters().put("http.path", Arrays.asList("foo.bar"));
HttpResponse response = namedHandler.handle(req);
assertThat(SessionHandlerTest.getRenderedString(response), is("{\"children\":[],\"configs\":[]}"));
}
use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class ApplicationContentHandlerTest method assertNotFound.
private void assertNotFound(HttpRequest request) {
HttpResponse response = handler.handle(request);
assertNotNull(response);
assertThat(response.getStatus(), is(Response.Status.NOT_FOUND));
}
use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class HostHandlerTest method assertErrorForHost.
private void assertErrorForHost(String hostname, int expectedStatus, HttpErrorResponse.errorCodes errorCode, String expectedResponse) throws IOException {
String url = urlPrefix + hostname;
HttpResponse response = handler.handle(HttpRequest.createTestRequest(url, com.yahoo.jdisc.http.HttpRequest.Method.GET));
HandlerTest.assertHttpStatusCodeErrorCodeAndMessage(response, expectedStatus, errorCode, expectedResponse);
}
use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class HostHandlerTest method assertApplicationForHost.
private void assertApplicationForHost(String hostname, TenantName expectedTenantName, ApplicationId expectedApplicationId, Zone zone) throws IOException {
String url = urlPrefix + hostname;
HttpResponse response = handler.handle(HttpRequest.createTestRequest(url, com.yahoo.jdisc.http.HttpRequest.Method.GET));
HandlerTest.assertHttpStatusCodeAndMessage(response, Response.Status.OK, "{\"tenant\":\"" + expectedTenantName.value() + "\"," + "\"application\":\"" + expectedApplicationId.application().value() + "\"," + "\"environment\":\"" + zone.environment().value() + "\"," + "\"region\":\"" + zone.region().value() + "\"," + "\"instance\":\"" + expectedApplicationId.instance().value() + "\"}");
}
Aggregations