AwsHelper { public ClientConfiguration getClientConfiguration(AwsParamsDto awsParamsDto) { ClientConfiguration clientConfiguration = new ClientConfiguration(); clientConfiguration.withRetryPolicy(retryPolicyFactory.getRetryPolicy()); if (StringUtils.isNotBlank(awsParamsDto.getHttpProxyHost()) && awsParamsDto.getHttpProxyPort() != null) { clientConfiguration.withProxyHost(awsParamsDto.getHttpProxyHost()).withProxyPort(awsParamsDto.getHttpProxyPort()); } return clientConfiguration; }  AwsParamsDto getAwsParamsDto(); ClientConfiguration getClientConfiguration(AwsParamsDto awsParamsDto); Double getTransferRateInKilobytesPerSecond(Long totalBytesTransferred, Long durationMillis); Double getTransferRateInMegabitsPerSecond(Long totalBytesTransferred, Long durationMillis);  }
@Test public void testGetClientConfiguration() throws Exception { for (String testHttpProxyHost : Arrays.asList(STRING_VALUE, BLANK_TEXT, null)) { for (Integer testHttpProxyPort : Arrays.asList(INTEGER_VALUE, null)) { AwsParamsDto testAwsParamsDto = awsHelper.getAwsParamsDto(); testAwsParamsDto.setHttpProxyHost(testHttpProxyHost); testAwsParamsDto.setHttpProxyPort(testHttpProxyPort); ClientConfiguration resultClientConfiguration = awsHelper.getClientConfiguration(testAwsParamsDto); assertNotNull(resultClientConfiguration); if (STRING_VALUE.equals(testHttpProxyHost) && INTEGER_VALUE.equals(testHttpProxyPort)) { assertEquals(testHttpProxyHost, resultClientConfiguration.getProxyHost()); assertEquals(testHttpProxyPort, Integer.valueOf(resultClientConfiguration.getProxyPort())); } else { assertNull(resultClientConfiguration.getProxyHost()); assertEquals(-1, resultClientConfiguration.getProxyPort()); } } } }