use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class AccessLogRequestHandlerTest method testOneLogLine.
@Test
public void testOneLogLine() throws IOException {
keeper.addUri("foo");
HttpResponse response = handler.handle(null);
response.render(out);
assertThat(out.toString(), is("{\"entries\":[{\"url\":\"foo\"}]}"));
}
use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class AccessLogRequestHandlerTest method testEmpty.
@Test
public void testEmpty() throws IOException {
HttpResponse response = handler.handle(null);
response.render(out);
assertThat(out.toString(), is("{\"entries\":[]}"));
}
use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class ApplicationHandlerTest method assertApplicationGeneration.
private void assertApplicationGeneration(String url, long expectedGeneration) throws IOException {
HttpResponse response = mockHandler.handle(HttpRequest.createTestRequest(url, com.yahoo.jdisc.http.HttpRequest.Method.GET));
HandlerTest.assertHttpStatusCodeAndMessage(response, 200, "{\"generation\":" + expectedGeneration + "}");
}
use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class ApplicationHandlerTest method grabLog.
private String grabLog(ApplicationId application, Zone zone) throws IOException {
String restartUrl = toUrlPath(application, zone, true) + "/log";
HttpResponse response = mockHandler.handle(HttpRequest.createTestRequest(restartUrl, com.yahoo.jdisc.http.HttpRequest.Method.POST));
HandlerTest.assertHttpStatusCodeAndMessage(response, 200, "");
return SessionHandlerTest.getRenderedString(response);
}
use of com.yahoo.container.jdisc.HttpResponse in project vespa by vespa-engine.
the class ApplicationHandlerTest method converge.
private void converge(ApplicationId application, Zone zone) throws IOException {
String convergeUrl = toUrlPath(application, zone, true) + "/serviceconverge";
HttpResponse response = mockHandler.handle(HttpRequest.createTestRequest(convergeUrl, com.yahoo.jdisc.http.HttpRequest.Method.GET));
HandlerTest.assertHttpStatusCodeAndMessage(response, 200, "");
}
Aggregations