test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/helper/StorageHelperTest.java
test_class.identifier: StorageHelperTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testGetStorageAttributeValueByNameFromStorage()
      {
          final String testStorageName = "MY_TEST_STORAGE";
          final String testAttributeNameNoExists = "I_DO_NOT_EXIST";
  
          Storage testStorage = new Storage();
          testStorage.setName(testStorageName);
          testStorage.setAttributes(businessObjectDefinitionServiceTestHelper.getNewAttributes());
  
          assertEquals(ATTRIBUTE_VALUE_1, storageHelper.getStorageAttributeValueByName(ATTRIBUTE_NAME_1_MIXED_CASE, testStorage, Boolean.FALSE));
          assertEquals(ATTRIBUTE_VALUE_2, storageHelper.getStorageAttributeValueByName(ATTRIBUTE_NAME_2_MIXED_CASE, testStorage, Boolean.TRUE));
  
          // Testing attribute name case insensitivity.
          assertEquals(ATTRIBUTE_VALUE_1, storageHelper.getStorageAttributeValueByName(ATTRIBUTE_NAME_1_MIXED_CASE.toLowerCase(), testStorage, Boolean.TRUE));
          assertEquals(ATTRIBUTE_VALUE_1, storageHelper.getStorageAttributeValueByName(ATTRIBUTE_NAME_1_MIXED_CASE.toUpperCase(), testStorage, Boolean.TRUE));
  
          assertNull(storageHelper.getStorageAttributeValueByName(testAttributeNameNoExists, testStorage, Boolean.FALSE));
  
          // Try to get a required attribute value what does not exist.
          try
          {
              storageHelper.getStorageAttributeValueByName(testAttributeNameNoExists, testStorage, Boolean.TRUE);
              fail("Suppose to throw a RuntimeException when required storage attribute does not exist or has a blank value.");
          }
          catch (RuntimeException e)
          {
              assertEquals(String.format("Attribute \"%s\" for \"%s\" storage must be configured.", testAttributeNameNoExists, testStorage.getName()),
                  e.getMessage());
          }
      }
test_case.class_method_signature: StorageHelperTest.testGetStorageAttributeValueByNameFromStorage()
test_case.full_signature: @Test public void testGetStorageAttributeValueByNameFromStorage()
test_case.identifier: testGetStorageAttributeValueByNameFromStorage
test_case.invocations: setName setAttributes getNewAttributes assertEquals getStorageAttributeValueByName assertEquals getStorageAttributeValueByName assertEquals getStorageAttributeValueByName toLowerCase assertEquals getStorageAttributeValueByName toUpperCase assertNull getStorageAttributeValueByName getStorageAttributeValueByName fail assertEquals format getName getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetStorageAttributeValueByNameFromStorage()
focal_class.declarator: stsDao
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected StsDao stsDao;
focal_class.type: StsDao
focal_class.var_name: stsDao
focal_class.declarator: configurationHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ConfigurationHelper configurationHelper;
focal_class.type: ConfigurationHelper
focal_class.var_name: configurationHelper
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/helper/StorageHelper.java
focal_class.identifier: StorageHelper
focal_class.class_method_signature: StorageHelper.getBooleanStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.full_signature: public boolean getBooleanStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.identifier: getBooleanStorageAttributeValueByName
focal_class.modifiers: public
focal_class.parameters: (String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.return: boolean
focal_class.signature: boolean getBooleanStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.class_method_signature: StorageHelper.getS3BucketAccessParams(StorageEntity storageEntity)
focal_class.full_signature: public S3FileTransferRequestParamsDto getS3BucketAccessParams(StorageEntity storageEntity)
focal_class.identifier: getS3BucketAccessParams
focal_class.modifiers: public
focal_class.parameters: (StorageEntity storageEntity)
focal_class.return: S3FileTransferRequestParamsDto
focal_class.signature: S3FileTransferRequestParamsDto getS3BucketAccessParams(StorageEntity storageEntity)
focal_class.class_method_signature: StorageHelper.getS3FileCopyRequestParamsDto()
focal_class.full_signature: public S3FileCopyRequestParamsDto getS3FileCopyRequestParamsDto()
focal_class.identifier: getS3FileCopyRequestParamsDto
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: S3FileCopyRequestParamsDto
focal_class.signature: S3FileCopyRequestParamsDto getS3FileCopyRequestParamsDto()
focal_class.class_method_signature: StorageHelper.getS3FileTransferRequestParamsDto()
focal_class.full_signature: public S3FileTransferRequestParamsDto getS3FileTransferRequestParamsDto()
focal_class.identifier: getS3FileTransferRequestParamsDto
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: S3FileTransferRequestParamsDto
focal_class.signature: S3FileTransferRequestParamsDto getS3FileTransferRequestParamsDto()
focal_class.class_method_signature: StorageHelper.getS3FileTransferRequestParamsDtoByRole(String roleArn, String sessionName)
focal_class.full_signature: public S3FileTransferRequestParamsDto getS3FileTransferRequestParamsDtoByRole(String roleArn, String sessionName)
focal_class.identifier: getS3FileTransferRequestParamsDtoByRole
focal_class.modifiers: public
focal_class.parameters: (String roleArn, String sessionName)
focal_class.return: S3FileTransferRequestParamsDto
focal_class.signature: S3FileTransferRequestParamsDto getS3FileTransferRequestParamsDtoByRole(String roleArn, String sessionName)
focal_class.class_method_signature: StorageHelper.getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, Integer defaultValue)
focal_class.full_signature: public Integer getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, Integer defaultValue)
focal_class.identifier: getStorageAttributeIntegerValueByName
focal_class.modifiers: public
focal_class.parameters: (String attributeName, StorageEntity storageEntity, Integer defaultValue)
focal_class.return: Integer
focal_class.signature: Integer getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, Integer defaultValue)
focal_class.class_method_signature: StorageHelper.getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.full_signature: public Integer getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.identifier: getStorageAttributeIntegerValueByName
focal_class.modifiers: public
focal_class.parameters: (String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.return: Integer
focal_class.signature: Integer getStorageAttributeIntegerValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.class_method_signature: StorageHelper.getStorageAttributeValueByName(String attributeName, Storage storage, Boolean required)
focal_class.full_signature: public String getStorageAttributeValueByName(String attributeName, Storage storage, Boolean required)
focal_class.identifier: getStorageAttributeValueByName
focal_class.modifiers: public
focal_class.parameters: (String attributeName, Storage storage, Boolean required)
focal_class.return: String
focal_class.signature: String getStorageAttributeValueByName(String attributeName, Storage storage, Boolean required)
focal_class.class_method_signature: StorageHelper.getStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeValueRequired)
focal_class.full_signature: public String getStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeValueRequired)
focal_class.identifier: getStorageAttributeValueByName
focal_class.modifiers: public
focal_class.parameters: (String attributeName, StorageEntity storageEntity, boolean attributeValueRequired)
focal_class.return: String
focal_class.signature: String getStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeValueRequired)
focal_class.class_method_signature: StorageHelper.getStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.full_signature: public String getStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.identifier: getStorageAttributeValueByName
focal_class.modifiers: public
focal_class.parameters: (String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.return: String
focal_class.signature: String getStorageAttributeValueByName(String attributeName, StorageEntity storageEntity, boolean attributeRequired,
          boolean attributeValueRequiredIfExists)
focal_class.class_method_signature: StorageHelper.getStorageBucketName(StorageEntity storageEntity)
focal_class.full_signature: public String getStorageBucketName(StorageEntity storageEntity)
focal_class.identifier: getStorageBucketName
focal_class.modifiers: public
focal_class.parameters: (StorageEntity storageEntity)
focal_class.return: String
focal_class.signature: String getStorageBucketName(StorageEntity storageEntity)
focal_class.class_method_signature: StorageHelper.getStorageKmsKeyId(StorageEntity storageEntity)
focal_class.full_signature: public String getStorageKmsKeyId(StorageEntity storageEntity)
focal_class.identifier: getStorageKmsKeyId
focal_class.modifiers: public
focal_class.parameters: (StorageEntity storageEntity)
focal_class.return: String
focal_class.signature: String getStorageKmsKeyId(StorageEntity storageEntity)
focal_class.class_method_signature: StorageHelper.setProxyHostAndPort(S3FileTransferRequestParamsDto params)
focal_class.full_signature: private void setProxyHostAndPort(S3FileTransferRequestParamsDto params)
focal_class.identifier: setProxyHostAndPort
focal_class.modifiers: private
focal_class.parameters: (S3FileTransferRequestParamsDto params)
focal_class.return: void
focal_class.signature: void setProxyHostAndPort(S3FileTransferRequestParamsDto params)
focal_method.body: public String getStorageAttributeValueByName(String attributeName, Storage storage, Boolean required)
      {
          String attributeValue = null;
  
          for (Attribute attribute : storage.getAttributes())
          {
              if (attribute.getName().equalsIgnoreCase(attributeName))
              {
                  attributeValue = attribute.getValue();
                  break;
              }
          }
  
          if (required && StringUtils.isBlank(attributeValue))
          {
              throw new IllegalStateException(String.format("Attribute \"%s\" for \"%s\" storage must be configured.", attributeName, storage.getName()));
          }
  
          return attributeValue;
      }
focal_method.class_method_signature: StorageHelper.getStorageAttributeValueByName(String attributeName, Storage storage, Boolean required)
focal_method.full_signature: public String getStorageAttributeValueByName(String attributeName, Storage storage, Boolean required)
focal_method.identifier: getStorageAttributeValueByName
focal_method.invocations: getAttributes equalsIgnoreCase getName getValue isBlank format getName
focal_method.modifiers: public
focal_method.parameters: (String attributeName, Storage storage, Boolean required)
focal_method.return: String
focal_method.signature: String getStorageAttributeValueByName(String attributeName, Storage storage, Boolean required)