Search in sources :

Example 1 with HttpClientConfiguration

use of org.apache.beam.sdk.io.aws2.common.HttpClientConfiguration in project beam by apache.

the class AwsOptionsTest method testSetHttpClientConfiguration.

@Test
public void testSetHttpClientConfiguration() {
    AwsOptions options = create("--httpClientConfiguration={" + "\"connectionAcquisitionTimeout\":100," + "\"connectionMaxIdleTime\":200," + "\"connectionTimeout\":300," + "\"connectionTimeToLive\":400," + "\"socketTimeout\":500," + "\"readTimeout\":600," + "\"writeTimeout\":700," + "\"maxConnections\":10}");
    HttpClientConfiguration expected = HttpClientConfiguration.builder().connectionAcquisitionTimeout(100).connectionMaxIdleTime(200).connectionTimeout(300).connectionTimeToLive(400).socketTimeout(500).readTimeout(600).writeTimeout(700).maxConnections(10).build();
    assertThat(options.getHttpClientConfiguration()).isEqualTo(expected);
    assertThat(serializeDeserialize(options).getHttpClientConfiguration()).isEqualTo(expected);
}
Also used : HttpClientConfiguration(org.apache.beam.sdk.io.aws2.common.HttpClientConfiguration) Test(org.junit.Test)

Example 2 with HttpClientConfiguration

use of org.apache.beam.sdk.io.aws2.common.HttpClientConfiguration in project beam by apache.

the class AwsModuleTest method testHttpClientConfigurationSerializationDeserialization.

@Test
public void testHttpClientConfigurationSerializationDeserialization() throws Exception {
    HttpClientConfiguration expected = HttpClientConfiguration.builder().connectionAcquisitionTimeout(100).connectionMaxIdleTime(200).connectionTimeout(300).connectionTimeToLive(400).socketTimeout(500).readTimeout(600).writeTimeout(700).maxConnections(10).build();
    assertThat(serializeAndDeserialize(expected)).isEqualTo(expected);
}
Also used : HttpClientConfiguration(org.apache.beam.sdk.io.aws2.common.HttpClientConfiguration) Test(org.junit.Test)

Aggregations

HttpClientConfiguration (org.apache.beam.sdk.io.aws2.common.HttpClientConfiguration)2 Test (org.junit.Test)2