use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWriteTimeout.
@Test
public void testCreateNettyAsyncHttpClientWriteTimeout() throws Exception {
Duration writeTimeout = Duration.ofMillis(3000);
AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.WRITE_TIMEOUT, writeTimeout).build();
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(writeTimeout.toMillis(), nettyConfiguration.writeTimeoutMillis());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsTlsKeyManagersProvider.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsTlsKeyManagersProvider() 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.tlsKeyManagersProvider(), nettyConfiguration.tlsKeyManagersProvider());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientReadTimeout.
@Test
public void testCreateNettyAsyncHttpClientReadTimeout() throws Exception {
Duration readTimeout = Duration.ofMillis(1234);
AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.READ_TIMEOUT, readTimeout).build();
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(readTimeout.toMillis(), nettyConfiguration.readTimeoutMillis());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsConnectionTimeout.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsConnectionTimeout() 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.connectTimeoutMillis(), nettyConfiguration.connectTimeoutMillis());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSAsyncSinkUtilTest method testCreateKinesisAsyncClient.
@Test
public void testCreateKinesisAsyncClient() {
Properties properties = TestUtil.properties(AWS_REGION, "eu-west-2");
MockAsyncClientBuilder builder = mockKinesisAsyncClientBuilder();
ClientOverrideConfiguration clientOverrideConfiguration = ClientOverrideConfiguration.builder().build();
SdkAsyncHttpClient httpClient = NettyNioAsyncHttpClient.builder().build();
AWSAsyncSinkUtil.createAwsAsyncClient(properties, builder, httpClient, clientOverrideConfiguration);
verify(builder).overrideConfiguration(clientOverrideConfiguration);
verify(builder).httpClient(httpClient);
verify(builder).region(Region.of("eu-west-2"));
verify(builder).credentialsProvider(argThat(cp -> cp instanceof DefaultCredentialsProvider));
verify(builder, never()).endpointOverride(any());
}
Aggregations