test_class.declarator: awsHelper
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private AwsHelper awsHelper;
test_class.type: AwsHelper
test_class.var_name: awsHelper
test_class.file: herd-code/herd-dao/src/test/java/org/finra/herd/dao/helper/AwsHelperTest.java
test_class.identifier: AwsHelperTest
test_class.superclass: extends AbstractDaoTest
test_case.body: @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());
                  }
              }
          }
      }
test_case.class_method_signature: AwsHelperTest.testGetClientConfiguration()
test_case.full_signature: @Test public void testGetClientConfiguration()
test_case.identifier: testGetClientConfiguration
test_case.invocations: asList asList getAwsParamsDto setHttpProxyHost setHttpProxyPort getClientConfiguration assertNotNull equals equals assertEquals getProxyHost assertEquals valueOf getProxyPort assertNull getProxyHost assertEquals getProxyPort
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetClientConfiguration()
focal_class.declarator: BITS_PER_BYTE = 8
focal_class.modifier: private static final
focal_class.original_string: private static final int BITS_PER_BYTE = 8;
focal_class.type: int
focal_class.var_name: BITS_PER_BYTE
focal_class.declarator: configurationHelper
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected ConfigurationHelper configurationHelper;
focal_class.type: ConfigurationHelper
focal_class.var_name: configurationHelper
focal_class.declarator: herdStringHelper
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected HerdStringHelper herdStringHelper;
focal_class.type: HerdStringHelper
focal_class.var_name: herdStringHelper
focal_class.declarator: retryPolicyFactory
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected RetryPolicyFactory retryPolicyFactory;
focal_class.type: RetryPolicyFactory
focal_class.var_name: retryPolicyFactory
focal_class.file: herd-code/herd-dao/src/main/java/org/finra/herd/dao/helper/AwsHelper.java
focal_class.identifier: AwsHelper
focal_class.class_method_signature: AwsHelper.getAwsParamsDto()
focal_class.full_signature: public AwsParamsDto getAwsParamsDto()
focal_class.identifier: getAwsParamsDto
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: AwsParamsDto
focal_class.signature: AwsParamsDto getAwsParamsDto()
focal_class.class_method_signature: AwsHelper.getClientConfiguration(AwsParamsDto awsParamsDto)
focal_class.full_signature: public ClientConfiguration getClientConfiguration(AwsParamsDto awsParamsDto)
focal_class.identifier: getClientConfiguration
focal_class.modifiers: public
focal_class.parameters: (AwsParamsDto awsParamsDto)
focal_class.return: ClientConfiguration
focal_class.signature: ClientConfiguration getClientConfiguration(AwsParamsDto awsParamsDto)
focal_class.class_method_signature: AwsHelper.getTransferRateInKilobytesPerSecond(Long totalBytesTransferred, Long durationMillis)
focal_class.full_signature: public Double getTransferRateInKilobytesPerSecond(Long totalBytesTransferred, Long durationMillis)
focal_class.identifier: getTransferRateInKilobytesPerSecond
focal_class.modifiers: public
focal_class.parameters: (Long totalBytesTransferred, Long durationMillis)
focal_class.return: Double
focal_class.signature: Double getTransferRateInKilobytesPerSecond(Long totalBytesTransferred, Long durationMillis)
focal_class.class_method_signature: AwsHelper.getTransferRateInMegabitsPerSecond(Long totalBytesTransferred, Long durationMillis)
focal_class.full_signature: public Double getTransferRateInMegabitsPerSecond(Long totalBytesTransferred, Long durationMillis)
focal_class.identifier: getTransferRateInMegabitsPerSecond
focal_class.modifiers: public
focal_class.parameters: (Long totalBytesTransferred, Long durationMillis)
focal_class.return: Double
focal_class.signature: Double getTransferRateInMegabitsPerSecond(Long totalBytesTransferred, Long durationMillis)
focal_method.body: public ClientConfiguration getClientConfiguration(AwsParamsDto awsParamsDto)
      {
          ClientConfiguration clientConfiguration = new ClientConfiguration();
  
          // Set a retry policy.
          clientConfiguration.withRetryPolicy(retryPolicyFactory.getRetryPolicy());
  
          // If the proxy hostname and port both are configured, set the HTTP proxy information.
          if (StringUtils.isNotBlank(awsParamsDto.getHttpProxyHost()) && awsParamsDto.getHttpProxyPort() != null)
          {
              clientConfiguration.withProxyHost(awsParamsDto.getHttpProxyHost()).withProxyPort(awsParamsDto.getHttpProxyPort());
          }
  
          return clientConfiguration;
      }
focal_method.class_method_signature: AwsHelper.getClientConfiguration(AwsParamsDto awsParamsDto)
focal_method.full_signature: public ClientConfiguration getClientConfiguration(AwsParamsDto awsParamsDto)
focal_method.identifier: getClientConfiguration
focal_method.invocations: withRetryPolicy getRetryPolicy isNotBlank getHttpProxyHost getHttpProxyPort withProxyPort withProxyHost getHttpProxyHost getHttpProxyPort
focal_method.modifiers: public
focal_method.parameters: (AwsParamsDto awsParamsDto)
focal_method.return: ClientConfiguration
focal_method.signature: ClientConfiguration getClientConfiguration(AwsParamsDto awsParamsDto)