本文整理汇总了Java中io.reactivex.netty.protocol.http.server.HttpRequestHeaders类的典型用法代码示例。如果您正苦于以下问题:Java HttpRequestHeaders类的具体用法?Java HttpRequestHeaders怎么用?Java HttpRequestHeaders使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HttpRequestHeaders类属于io.reactivex.netty.protocol.http.server包,在下文中一共展示了HttpRequestHeaders类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRouteTriathlon
import io.reactivex.netty.protocol.http.server.HttpRequestHeaders; //导入依赖的package包/类
@Test
public void testRouteTriathlon() throws Exception {
Observable<Void> observable = Mockito.mock(Observable.class);
when(this.triathlonEndpoint.postApps(any(), any())).thenReturn(observable);
HttpRequestHeaders headers = Mockito.mock(HttpRequestHeaders.class);
List<String> uris = Lists.newArrayList(
"/v2/apps"
);
while(uris.size()>0){
String uri = uris.remove(0);
request = getRequest(uri, headers, HttpMethod.POST);
response = getResponse();
this.triathlonRouter.handle(request, response);
verify(this.triathlonEndpoint, times(1)).postApps(request, response);
}
request = getRequest("/someOtherUri", headers, HttpMethod.POST);
response = getResponse();
this.triathlonRouter.handle(request, response);
verify(this.triathlonEndpoint,times(0)).postApps(request, response);
verify(response, times(1)).setStatus(argThat(matchResponseStatus(HttpResponseStatus.NOT_FOUND)));
}
示例2: getRequest
import io.reactivex.netty.protocol.http.server.HttpRequestHeaders; //导入依赖的package包/类
private HttpServerRequest getRequest(String path, HttpRequestHeaders headers, HttpMethod method){
HttpServerRequest request = Mockito.mock(HttpServerRequest.class);
when(request.getHeaders()).thenReturn(headers);
when(request.getHttpMethod()).thenReturn(method);
when(request.getHttpVersion()).thenReturn(HttpVersion.HTTP_1_1);
when(request.getPath()).thenReturn(path);
when(request.getQueryString()).thenReturn("");
when(request.getUri()).thenReturn(path);
when(request.getQueryParameters()).thenReturn(new HashMap<String, List<String>>());
when(request.getCookies()).thenReturn(new HashMap<String, Set<String>>());
when(request.getNettyChannel()).thenReturn(new LocalChannel());
return request;
}
示例3: JerseyRequestHeadersAdapter
import io.reactivex.netty.protocol.http.server.HttpRequestHeaders; //导入依赖的package包/类
private JerseyRequestHeadersAdapter(HttpRequestHeaders requestHeaders) {
this.requestHeaders = requestHeaders;
}