Java Code Examples for com.linecorp.armeria.common.SessionProtocol#H2C

The following examples show how to use com.linecorp.armeria.common.SessionProtocol#H2C . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BraveClientIntegrationTest.java    From armeria with Apache License 2.0 5 votes vote down vote up
public BraveClientIntegrationTest(SessionProtocol sessionProtocol) {
    this.sessionProtocol = sessionProtocol;

    if (sessionProtocol == SessionProtocol.H2C) {
        protocols = ImmutableList.of(Protocol.H2_PRIOR_KNOWLEDGE);
    } else {
        protocols = ImmutableList.of(Protocol.HTTP_1_1);
    }
}
 
Example 2
Source File: DefaultClientRequestContextTest.java    From armeria with Apache License 2.0 5 votes vote down vote up
private static DefaultClientRequestContext newContext() {
    final DefaultClientRequestContext ctx = new DefaultClientRequestContext(
            mock(EventLoop.class), NoopMeterRegistry.get(), SessionProtocol.H2C,
            RequestId.random(), HttpMethod.POST, "/foo", null, null,
            ClientOptions.of(),
            HttpRequest.of(RequestHeaders.of(
                    HttpMethod.POST, "/foo",
                    HttpHeaderNames.SCHEME, "http",
                    HttpHeaderNames.AUTHORITY, "example.com:8080")),
            null, System.nanoTime(), SystemInfo.currentTimeMicros());
    ctx.init(Endpoint.of("example.com", 8080));
    return ctx;
}