use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsReapIdleConnections.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsReapIdleConnections() throws Exception {
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
SdkAsyncHttpClient httpDefaultClient = NettyNioAsyncHttpClient.create();
NettyConfiguration nettyDefaultConfiguration = TestUtil.getNettyConfiguration(httpDefaultClient);
assertEquals(nettyDefaultConfiguration.reapIdleConnections(), nettyConfiguration.reapIdleConnections());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient 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));
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsTrustAllCertificates.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsTrustAllCertificates() throws Exception {
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(false, nettyConfiguration.trustAllCertificates());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientIdleConnectionReaper.
@Test
public void testCreateNettyAsyncHttpClientIdleConnectionReaper() throws Exception {
boolean reapIdleConnections = false;
AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.REAP_IDLE_CONNECTIONS, reapIdleConnections).build();
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(reapIdleConnections, nettyConfiguration.reapIdleConnections());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsTlsTrustManagersProvider.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsTlsTrustManagersProvider() throws Exception {
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
SdkAsyncHttpClient httpDefaultClient = NettyNioAsyncHttpClient.create();
NettyConfiguration nettyDefaultConfiguration = TestUtil.getNettyConfiguration(httpDefaultClient);
assertEquals(nettyDefaultConfiguration.tlsTrustManagersProvider(), nettyConfiguration.tlsTrustManagersProvider());
}
Aggregations