use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsConnectionAcquireTimeout.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsConnectionAcquireTimeout() throws Exception {
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(60_000, nettyConfiguration.connectionAcquireTimeoutMillis());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithPropertyTrustAllCertificates.
@Test
public void testCreateNettyAsyncHttpClientWithPropertyTrustAllCertificates() throws Exception {
boolean trustAllCerts = true;
Properties properties = new Properties();
properties.setProperty(AWSConfigConstants.TRUST_ALL_CERTIFICATES, String.valueOf(trustAllCerts));
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(properties);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(trustAllCerts, nettyConfiguration.trustAllCertificates());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsWriteTimeout.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsWriteTimeout() 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.writeTimeoutMillis(), nettyConfiguration.writeTimeoutMillis());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient 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