@Test
public void testGetClientConfiguration() throws Exception
{

    // Try to get AWS parameters using all possible permutations of HTTP proxy settings.
    for (String testHttpProxyHost : Arrays.asList(STRING_VALUE, BLANK_TEXT, null))
    {
        for (Integer testHttpProxyPort : Arrays.asList(INTEGER_VALUE, null))
        {
            // Create AWS parameters DTO.
            AwsParamsDto testAwsParamsDto = awsHelper.getAwsParamsDto();
            testAwsParamsDto.setHttpProxyHost(testHttpProxyHost);
            testAwsParamsDto.setHttpProxyPort(testHttpProxyPort);
            // Get client configuration.
            ClientConfiguration resultClientConfiguration = awsHelper.getClientConfiguration(testAwsParamsDto);
            // Validate the results.
            assertNotNull(resultClientConfiguration);
            // The proxy settings are set only when both host and port are specified in the AWS parameters DTO.
            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());
            }
        }
    }
}