use of com.yahoo.jdisc.http.server.jetty.SimpleHttpClient.ResponseValidator in project vespa by vespa-engine.
the class HttpServerTest method requireThatFormParametersAreParsed.
@Test
public void requireThatFormParametersAreParsed() throws Exception {
final TestDriver driver = TestDrivers.newInstance(new ParameterPrinterRequestHandler());
final ResponseValidator response = driver.client().newPost("/status.html").addHeader(CONTENT_TYPE, APPLICATION_X_WWW_FORM_URLENCODED).setContent("a=b&c=d").execute();
response.expectStatusCode(is(OK)).expectContent(startsWith("{a=[b], c=[d]}"));
assertThat(driver.close(), is(true));
}
use of com.yahoo.jdisc.http.server.jetty.SimpleHttpClient.ResponseValidator 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.SimpleHttpClient.ResponseValidator 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.SimpleHttpClient.ResponseValidator 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.SimpleHttpClient.ResponseValidator 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