当前位置: 首页>>代码示例>>Java>>正文


Java HttpRequestHeaders类代码示例

本文整理汇总了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)));
}
 
开发者ID:schibsted,项目名称:triathlon,代码行数:23,代码来源:TriathlonRouterTest.java

示例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;
}
 
开发者ID:schibsted,项目名称:triathlon,代码行数:14,代码来源:TriathlonRouterTest.java

示例3: JerseyRequestHeadersAdapter

import io.reactivex.netty.protocol.http.server.HttpRequestHeaders; //导入依赖的package包/类
private JerseyRequestHeadersAdapter(HttpRequestHeaders requestHeaders) {
    this.requestHeaders = requestHeaders;
}
 
开发者ID:Netflix,项目名称:karyon,代码行数:4,代码来源:NettyToJerseyBridge.java


注:本文中的io.reactivex.netty.protocol.http.server.HttpRequestHeaders类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。