Search in sources :

Example 1 with Protocol

use of software.amazon.awssdk.http.Protocol in project flink by apache.

the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientHttpVersion.

@Test
public void testCreateNettyAsyncHttpClientHttpVersion() throws Exception {
    Protocol httpVersion = HTTP1_1;
    AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.PROTOCOL, httpVersion).build();
    NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
    SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
    NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
    assertEquals(httpVersion, nettyConfiguration.attribute(SdkHttpConfigurationOption.PROTOCOL));
}
Also used : AttributeMap(software.amazon.awssdk.utils.AttributeMap) NettyNioAsyncHttpClient(software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient) NettyConfiguration(software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Protocol(software.amazon.awssdk.http.Protocol) Test(org.junit.Test)

Example 2 with Protocol

use of software.amazon.awssdk.http.Protocol in project flink by apache.

the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithPropertyProtocol.

@Test
public void testCreateNettyAsyncHttpClientWithPropertyProtocol() throws Exception {
    Protocol httpVersion = HTTP1_1;
    Properties properties = new Properties();
    properties.setProperty(AWSConfigConstants.HTTP_PROTOCOL_VERSION, String.valueOf(httpVersion));
    SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(properties);
    NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
    assertEquals(httpVersion, nettyConfiguration.attribute(SdkHttpConfigurationOption.PROTOCOL));
}
Also used : NettyConfiguration(software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Protocol(software.amazon.awssdk.http.Protocol) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 Protocol (software.amazon.awssdk.http.Protocol)2 SdkAsyncHttpClient (software.amazon.awssdk.http.async.SdkAsyncHttpClient)2 NettyConfiguration (software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration)2 Properties (java.util.Properties)1 NettyNioAsyncHttpClient (software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient)1 AttributeMap (software.amazon.awssdk.utils.AttributeMap)1