use of software.amazon.awssdk.utils.AttributeMap 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.utils.AttributeMap in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientIdleConnectionTtl.
@Test
public void testCreateNettyAsyncHttpClientIdleConnectionTtl() throws Exception {
Duration connectionTtl = Duration.ofMillis(5000);
AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.CONNECTION_TIME_TO_LIVE, connectionTtl).build();
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(connectionTtl.toMillis(), nettyConfiguration.connectionTtlMillis());
}
use of software.amazon.awssdk.utils.AttributeMap in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientTrustAllCertificates.
@Test
public void testCreateNettyAsyncHttpClientTrustAllCertificates() throws Exception {
boolean trustAllCertificates = true;
AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES, trustAllCertificates).build();
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(trustAllCertificates, nettyConfiguration.trustAllCertificates());
}
use of software.amazon.awssdk.utils.AttributeMap in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientMaxConcurrency.
@Test
public void testCreateNettyAsyncHttpClientMaxConcurrency() throws Exception {
int maxConnections = 123;
AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.MAX_CONNECTIONS, maxConnections).build();
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(maxConnections, nettyConfiguration.maxConnections());
}
Aggregations