Search in sources :

Example 6 with TestDriver

use of com.yahoo.jdisc.http.server.jetty.TestDriver in project vespa by vespa-engine.

the class ServletAccessLoggingTest method accessLogIsInvokedForNonJDiscServlet.

@Test
public void accessLogIsInvokedForNonJDiscServlet() throws Exception {
    final AccessLog accessLog = mock(AccessLog.class);
    final TestDriver testDriver = newTestDriver(accessLog);
    httpGet(testDriver, TestServlet.PATH).execute();
    verifyCallsLog(accessLog, timeout(MAX_LOG_WAIT_TIME_MILLIS).times(1));
}
Also used : AccessLog(com.yahoo.container.logging.AccessLog) TestDriver(com.yahoo.jdisc.http.server.jetty.TestDriver) Test(org.testng.annotations.Test)

Example 7 with TestDriver

use of com.yahoo.jdisc.http.server.jetty.TestDriver in project vespa by vespa-engine.

the class JDiscFilterForServletTest method request_can_be_forwarded_through_request_filter_to_servlet.

@Test
public void request_can_be_forwarded_through_request_filter_to_servlet() throws IOException {
    TestDriver testDriver = requestFilterTestDriver();
    ResponseValidator response = httpGet(testDriver, TestServlet.PATH).addHeader(TestRequestFilter.BYPASS_FILTER_HEADER, Boolean.TRUE.toString()).execute();
    response.expectContent(containsString(TestServlet.RESPONSE_CONTENT));
}
Also used : ResponseValidator(com.yahoo.jdisc.http.server.jetty.SimpleHttpClient.ResponseValidator) TestDriver(com.yahoo.jdisc.http.server.jetty.TestDriver) Test(org.testng.annotations.Test)

Aggregations

TestDriver (com.yahoo.jdisc.http.server.jetty.TestDriver)7 Test (org.testng.annotations.Test)7 ResponseValidator (com.yahoo.jdisc.http.server.jetty.SimpleHttpClient.ResponseValidator)5 AccessLog (com.yahoo.container.logging.AccessLog)2