Search in sources :

Example 1 with SdkClientConfiguration

use of software.amazon.awssdk.core.client.config.SdkClientConfiguration in project flink by apache.

the class AWSAsyncSinkUtilTest method testClientOverrideConfigurationApiCallAttemptTimeout.

@Test
public void testClientOverrideConfigurationApiCallAttemptTimeout() {
    SdkClientConfiguration clientConfiguration = SdkClientConfiguration.builder().option(SdkClientOption.API_CALL_ATTEMPT_TIMEOUT, Duration.ofMillis(500)).build();
    ClientOverrideConfiguration.Builder builder = mockClientOverrideConfigurationBuilder();
    AWSAsyncSinkUtil.createClientOverrideConfiguration(clientConfiguration, builder, formatFlinkUserAgentPrefix(DEFAULT_USER_AGENT_PREFIX_FORMAT_V2 + AWSAsyncSinkUtil.V2_USER_AGENT_SUFFIX));
    verify(builder).apiCallAttemptTimeout(Duration.ofMillis(500));
}
Also used : SdkClientConfiguration(software.amazon.awssdk.core.client.config.SdkClientConfiguration) ClientOverrideConfiguration(software.amazon.awssdk.core.client.config.ClientOverrideConfiguration) Test(org.junit.Test)

Example 2 with SdkClientConfiguration

use of software.amazon.awssdk.core.client.config.SdkClientConfiguration in project flink by apache.

the class AWSAsyncSinkUtilTest method testClientOverrideConfigurationApiCallTimeout.

@Test
public void testClientOverrideConfigurationApiCallTimeout() {
    SdkClientConfiguration clientConfiguration = SdkClientConfiguration.builder().option(SdkClientOption.API_CALL_TIMEOUT, Duration.ofMillis(600)).build();
    ClientOverrideConfiguration.Builder builder = mockClientOverrideConfigurationBuilder();
    AWSAsyncSinkUtil.createClientOverrideConfiguration(clientConfiguration, builder, formatFlinkUserAgentPrefix(DEFAULT_USER_AGENT_PREFIX_FORMAT_V2 + AWSAsyncSinkUtil.V2_USER_AGENT_SUFFIX));
    verify(builder).apiCallTimeout(Duration.ofMillis(600));
}
Also used : SdkClientConfiguration(software.amazon.awssdk.core.client.config.SdkClientConfiguration) ClientOverrideConfiguration(software.amazon.awssdk.core.client.config.ClientOverrideConfiguration) Test(org.junit.Test)

Example 3 with SdkClientConfiguration

use of software.amazon.awssdk.core.client.config.SdkClientConfiguration in project flink by apache.

the class AWSAsyncSinkUtilTest method testClientOverrideConfigurationWithDefaults.

@Test
public void testClientOverrideConfigurationWithDefaults() {
    SdkClientConfiguration clientConfiguration = SdkClientConfiguration.builder().build();
    ClientOverrideConfiguration.Builder builder = mockClientOverrideConfigurationBuilder();
    AWSAsyncSinkUtil.createClientOverrideConfiguration(clientConfiguration, builder, formatFlinkUserAgentPrefix(DEFAULT_USER_AGENT_PREFIX_FORMAT + AWSAsyncSinkUtil.V2_USER_AGENT_SUFFIX));
    verify(builder).build();
    verify(builder).putAdvancedOption(SdkAdvancedClientOption.USER_AGENT_PREFIX, formatFlinkUserAgentPrefix(DEFAULT_USER_AGENT_PREFIX_FORMAT_V2));
    verify(builder).putAdvancedOption(SdkAdvancedClientOption.USER_AGENT_SUFFIX, null);
    verify(builder, never()).apiCallAttemptTimeout(any());
    verify(builder, never()).apiCallTimeout(any());
}
Also used : SdkClientConfiguration(software.amazon.awssdk.core.client.config.SdkClientConfiguration) ClientOverrideConfiguration(software.amazon.awssdk.core.client.config.ClientOverrideConfiguration) Test(org.junit.Test)

Example 4 with SdkClientConfiguration

use of software.amazon.awssdk.core.client.config.SdkClientConfiguration in project flink by apache.

the class AWSAsyncSinkUtilTest method testClientOverrideConfigurationUserAgentSuffix.

@Test
public void testClientOverrideConfigurationUserAgentSuffix() {
    SdkClientConfiguration clientConfiguration = SdkClientConfiguration.builder().option(SdkAdvancedClientOption.USER_AGENT_SUFFIX, "suffix").build();
    ClientOverrideConfiguration.Builder builder = mockClientOverrideConfigurationBuilder();
    AWSAsyncSinkUtil.createClientOverrideConfiguration(clientConfiguration, builder, formatFlinkUserAgentPrefix(DEFAULT_USER_AGENT_PREFIX_FORMAT + AWSAsyncSinkUtil.V2_USER_AGENT_SUFFIX));
    verify(builder).putAdvancedOption(SdkAdvancedClientOption.USER_AGENT_SUFFIX, "suffix");
}
Also used : SdkClientConfiguration(software.amazon.awssdk.core.client.config.SdkClientConfiguration) ClientOverrideConfiguration(software.amazon.awssdk.core.client.config.ClientOverrideConfiguration) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 ClientOverrideConfiguration (software.amazon.awssdk.core.client.config.ClientOverrideConfiguration)4 SdkClientConfiguration (software.amazon.awssdk.core.client.config.SdkClientConfiguration)4