use of com.yahoo.jdisc.http.HttpRequest.Version in project vespa by vespa-engine.
the class ConnectionControlSearcherTestCase method doSearch.
private Result doSearch(URI uri, long connectedAtMillis, long nowMillis) {
SocketAddress remoteAddress = Mockito.mock(SocketAddress.class);
Version version = Version.HTTP_1_1;
Method method = Method.GET;
CurrentContainer container = Mockito.mock(CurrentContainer.class);
Mockito.when(container.newReference(Mockito.any())).thenReturn(Mockito.mock(Container.class));
final com.yahoo.jdisc.http.HttpRequest serverRequest = com.yahoo.jdisc.http.HttpRequest.newServerRequest(container, uri, method, version, remoteAddress, connectedAtMillis);
HttpRequest incoming = new HttpRequest(serverRequest, new ByteArrayInputStream(new byte[0]));
Query query = new Query(incoming);
Execution e = new Execution(new Chain<Searcher>(ConnectionControlSearcher.createTestInstance(() -> nowMillis)), Execution.Context.createContextStub());
Result r = e.search(query);
return r;
}
Aggregations