use of com.yahoo.application.container.handler.Request in project vespa by vespa-engine.
the class RestApiTest method get_fieldset_parameter_is_propagated.
@Test
public void get_fieldset_parameter_is_propagated() throws IOException {
Request request = new Request(String.format("http://localhost:%s/document/v1/namespace/document-type/docid/bar?fieldSet=foo,baz", getFirstListenPort()));
HttpGet get = new HttpGet(request.getUri());
String rest = doRest(get);
assertThat(rest, containsString("\"fieldset\":\"foo,baz\""));
}
use of com.yahoo.application.container.handler.Request in project vespa by vespa-engine.
the class RestApiTest method invalid_wanted_document_count_parameter_returns_error_response.
@Test
public void invalid_wanted_document_count_parameter_returns_error_response() throws IOException {
Request request = new Request(String.format("http://localhost:%s/document/v1/namespace/document-type/docid/?wantedDocumentCount=aardvark", getFirstListenPort()));
HttpGet get = new HttpGet(request.getUri());
String rest = doRest(get);
assertThat(rest, containsString("Invalid 'wantedDocumentCount' value. Expected positive integer"));
}
use of com.yahoo.application.container.handler.Request in project vespa by vespa-engine.
the class RestApiTest method getLog.
// Get logs through some hackish fetch method. Logs is something the mocked backend write.
String getLog() throws IOException {
// The mocked backend will throw a runtime exception wtih a log if delete is called three times..
Request request = new Request("http://localhost:" + getFirstListenPort() + remove_test_uri);
HttpDelete delete = new HttpDelete(request.getUri());
doRest(delete);
return doRest(delete);
}
use of com.yahoo.application.container.handler.Request in project vespa by vespa-engine.
the class RestApiTest method visit_concurrency_parameter_is_propagated.
@Test
public void visit_concurrency_parameter_is_propagated() throws IOException {
Request request = new Request(String.format("http://localhost:%s/document/v1/namespace/document-type/docid/?concurrency=42", getFirstListenPort()));
HttpGet get = new HttpGet(request.getUri());
String rest = doRest(get);
assertThat(rest, containsString("concurrency: 42"));
}
use of com.yahoo.application.container.handler.Request in project vespa by vespa-engine.
the class RestApiTest method testBadVisit.
@Test
public void testBadVisit() throws Exception {
Request request = new Request("http://localhost:" + getFirstListenPort() + visit_test_bad_uri);
HttpGet get = new HttpGet(request.getUri());
String rest = doRest(get);
assertThat(rest, containsString(visit_test_bad_response));
}
Aggregations