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));
}
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));
}
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());
}
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");
}
Aggregations