use of com.yahoo.jdisc.http.server.jetty.TestDriver in project vespa by vespa-engine.
the class ServletAccessLoggingTest method accessLogIsInvokedForJDiscServlet.
@Test
public void accessLogIsInvokedForJDiscServlet() throws Exception {
final AccessLog accessLog = mock(AccessLog.class);
final TestDriver testDriver = newTestDriver(accessLog);
testDriver.client().newGet("/status.html").execute();
verifyCallsLog(accessLog, timeout(MAX_LOG_WAIT_TIME_MILLIS).times(1));
}
use of com.yahoo.jdisc.http.server.jetty.TestDriver in project vespa by vespa-engine.
the class JDiscFilterForServletTest method request_filter_can_return_response.
@Test
public void request_filter_can_return_response() throws IOException, InterruptedException {
TestDriver testDriver = requestFilterTestDriver();
ResponseValidator response = httpGet(testDriver, TestServlet.PATH).execute();
response.expectContent(containsString(TestRequestFilter.responseContent));
}
use of com.yahoo.jdisc.http.server.jetty.TestDriver in project vespa by vespa-engine.
the class JDiscFilterForServletTest method response_filter_is_run_on_empty_async_response.
@Test
public void response_filter_is_run_on_empty_async_response() throws IOException {
TestDriver testDriver = responseFilterTestDriver();
ResponseValidator response = httpGet(testDriver, NoContentTestServlet.PATH).addHeader(NoContentTestServlet.HEADER_ASYNC, Boolean.TRUE.toString()).execute();
response.expectHeader(TestResponseFilter.INVOKED_HEADER, is(Boolean.TRUE.toString()));
}
use of com.yahoo.jdisc.http.server.jetty.TestDriver in project vespa by vespa-engine.
the class JDiscFilterForServletTest method response_filter_can_modify_response.
@Test
public void response_filter_can_modify_response() throws IOException {
TestDriver testDriver = responseFilterTestDriver();
ResponseValidator response = httpGet(testDriver, TestServlet.PATH).execute();
response.expectHeader(TestResponseFilter.INVOKED_HEADER, is(Boolean.TRUE.toString()));
}
use of com.yahoo.jdisc.http.server.jetty.TestDriver in project vespa by vespa-engine.
the class JDiscFilterForServletTest method response_filter_is_run_on_empty_sync_response.
@Test
public void response_filter_is_run_on_empty_sync_response() throws IOException {
TestDriver testDriver = responseFilterTestDriver();
ResponseValidator response = httpGet(testDriver, NoContentTestServlet.PATH).execute();
response.expectHeader(TestResponseFilter.INVOKED_HEADER, is(Boolean.TRUE.toString()));
}
Aggregations