test_class.declarator: businessObjectDataDaoHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BusinessObjectDataDaoHelper businessObjectDataDaoHelper;
test_class.type: BusinessObjectDataDaoHelper
test_class.var_name: businessObjectDataDaoHelper
test_class.declarator: businessObjectDataHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BusinessObjectDataHelper businessObjectDataHelper;
test_class.type: BusinessObjectDataHelper
test_class.var_name: businessObjectDataHelper
test_class.declarator: businessObjectDataInitiateDestroyHelperServiceImpl
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private BusinessObjectDataInitiateDestroyHelperServiceImpl businessObjectDataInitiateDestroyHelperServiceImpl;
test_class.type: BusinessObjectDataInitiateDestroyHelperServiceImpl
test_class.var_name: businessObjectDataInitiateDestroyHelperServiceImpl
test_class.declarator: businessObjectFormatDao
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BusinessObjectFormatDao businessObjectFormatDao;
test_class.type: BusinessObjectFormatDao
test_class.var_name: businessObjectFormatDao
test_class.declarator: businessObjectFormatHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BusinessObjectFormatHelper businessObjectFormatHelper;
test_class.type: BusinessObjectFormatHelper
test_class.var_name: businessObjectFormatHelper
test_class.declarator: configurationHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ConfigurationHelper configurationHelper;
test_class.type: ConfigurationHelper
test_class.var_name: configurationHelper
test_class.declarator: herdDao
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private HerdDao herdDao;
test_class.type: HerdDao
test_class.var_name: herdDao
test_class.declarator: herdStringHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private HerdStringHelper herdStringHelper;
test_class.type: HerdStringHelper
test_class.var_name: herdStringHelper
test_class.declarator: s3KeyPrefixHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private S3KeyPrefixHelper s3KeyPrefixHelper;
test_class.type: S3KeyPrefixHelper
test_class.var_name: s3KeyPrefixHelper
test_class.declarator: s3Service
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private S3Service s3Service;
test_class.type: S3Service
test_class.var_name: s3Service
test_class.declarator: storageFileHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private StorageFileHelper storageFileHelper;
test_class.type: StorageFileHelper
test_class.var_name: storageFileHelper
test_class.declarator: storageHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private StorageHelper storageHelper;
test_class.type: StorageHelper
test_class.var_name: storageHelper
test_class.declarator: storageUnitDao
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private StorageUnitDao storageUnitDao;
test_class.type: StorageUnitDao
test_class.var_name: storageUnitDao
test_class.declarator: storageUnitDaoHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private StorageUnitDaoHelper storageUnitDaoHelper;
test_class.type: StorageUnitDaoHelper
test_class.var_name: storageUnitDaoHelper
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/impl/BusinessObjectDataInitiateDestroyHelperServiceImplTest.java
test_class.identifier: BusinessObjectDataInitiateDestroyHelperServiceImplTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testGetAndValidateStorageUnitInvalidStorageUnitStatus()
      {
          // Create a business object data key.
          BusinessObjectDataKey businessObjectDataKey =
              new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE,
                  NO_SUBPARTITION_VALUES, DATA_VERSION);
  
          // Create a business object data entity.
          BusinessObjectDataEntity businessObjectDataEntity = new BusinessObjectDataEntity();
          businessObjectDataEntity.setId(ID);
  
          // Create a storage entity.
          StorageEntity storageEntity = new StorageEntity();
          storageEntity.setName(STORAGE_NAME);
  
          // Create a storage unit status entity with an invalid value.
          StorageUnitStatusEntity storageUnitStatusEntity = new StorageUnitStatusEntity();
          storageUnitStatusEntity.setCode(INVALID_VALUE);
  
          // Create a storage unit entity with an invalid storage unit status.
          StorageUnitEntity storageUnitEntity = new StorageUnitEntity();
          storageUnitEntity.setStorage(storageEntity);
          storageUnitEntity.setStatus(storageUnitStatusEntity);
  
          // Mock the external calls.
          when(storageUnitDao.getStorageUnitsByStoragePlatformAndBusinessObjectData(StoragePlatformEntity.S3, businessObjectDataEntity))
              .thenReturn(Arrays.asList(storageUnitEntity));
          when(businessObjectDataHelper.businessObjectDataKeyToString(businessObjectDataKey)).thenReturn(BUSINESS_OBJECT_DATA_KEY_AS_STRING);
  
          // Try to call the method under test.
          try
          {
              businessObjectDataInitiateDestroyHelperServiceImpl.getAndValidateStorageUnit(businessObjectDataEntity, businessObjectDataKey);
              fail();
          }
          catch (IllegalArgumentException e)
          {
              assertEquals(String
                  .format("Storage unit status \"%s\" is not supported by the business object data destroy feature. Storage: {%s}, business object data: {%s}",
                      INVALID_VALUE, STORAGE_NAME, BUSINESS_OBJECT_DATA_KEY_AS_STRING), e.getMessage());
          }
  
          // Verify the external calls.
          verify(storageUnitDao).getStorageUnitsByStoragePlatformAndBusinessObjectData(StoragePlatformEntity.S3, businessObjectDataEntity);
          verify(businessObjectDataHelper).businessObjectDataKeyToString(businessObjectDataKey);
          verifyNoMoreInteractionsHelper();
      }
test_case.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImplTest.testGetAndValidateStorageUnitInvalidStorageUnitStatus()
test_case.full_signature: @Test public void testGetAndValidateStorageUnitInvalidStorageUnitStatus()
test_case.identifier: testGetAndValidateStorageUnitInvalidStorageUnitStatus
test_case.invocations: setId setName setCode setStorage setStatus thenReturn when getStorageUnitsByStoragePlatformAndBusinessObjectData asList thenReturn when businessObjectDataKeyToString getAndValidateStorageUnit fail assertEquals format getMessage getStorageUnitsByStoragePlatformAndBusinessObjectData verify businessObjectDataKeyToString verify verifyNoMoreInteractionsHelper
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetAndValidateStorageUnitInvalidStorageUnitStatus()
focal_class.declarator: SUPPORTED_STORAGE_UNIT_STATUSES = Collections.unmodifiableList(Arrays
          .asList(StorageUnitStatusEntity.ENABLED, StorageUnitStatusEntity.ARCHIVED, StorageUnitStatusEntity.RESTORED, StorageUnitStatusEntity.DISABLING,
              StorageUnitStatusEntity.DISABLED))
focal_class.modifier: private static final
focal_class.original_string: private static final List<String> SUPPORTED_STORAGE_UNIT_STATUSES = Collections.unmodifiableList(Arrays
          .asList(StorageUnitStatusEntity.ENABLED, StorageUnitStatusEntity.ARCHIVED, StorageUnitStatusEntity.RESTORED, StorageUnitStatusEntity.DISABLING,
              StorageUnitStatusEntity.DISABLED));
focal_class.type: List<String>
focal_class.var_name: SUPPORTED_STORAGE_UNIT_STATUSES
focal_class.declarator: businessObjectDataDaoHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectDataDaoHelper businessObjectDataDaoHelper;
focal_class.type: BusinessObjectDataDaoHelper
focal_class.var_name: businessObjectDataDaoHelper
focal_class.declarator: businessObjectDataHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectDataHelper businessObjectDataHelper;
focal_class.type: BusinessObjectDataHelper
focal_class.var_name: businessObjectDataHelper
focal_class.declarator: businessObjectFormatDao
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectFormatDao businessObjectFormatDao;
focal_class.type: BusinessObjectFormatDao
focal_class.var_name: businessObjectFormatDao
focal_class.declarator: businessObjectFormatHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectFormatHelper businessObjectFormatHelper;
focal_class.type: BusinessObjectFormatHelper
focal_class.var_name: businessObjectFormatHelper
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.declarator: herdDao
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private HerdDao herdDao;
focal_class.type: HerdDao
focal_class.var_name: herdDao
focal_class.declarator: herdStringHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private HerdStringHelper herdStringHelper;
focal_class.type: HerdStringHelper
focal_class.var_name: herdStringHelper
focal_class.declarator: s3KeyPrefixHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private S3KeyPrefixHelper s3KeyPrefixHelper;
focal_class.type: S3KeyPrefixHelper
focal_class.var_name: s3KeyPrefixHelper
focal_class.declarator: s3Service
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private S3Service s3Service;
focal_class.type: S3Service
focal_class.var_name: s3Service
focal_class.declarator: storageFileHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private StorageFileHelper storageFileHelper;
focal_class.type: StorageFileHelper
focal_class.var_name: storageFileHelper
focal_class.declarator: storageHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private StorageHelper storageHelper;
focal_class.type: StorageHelper
focal_class.var_name: storageHelper
focal_class.declarator: storageUnitDao
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private StorageUnitDao storageUnitDao;
focal_class.type: StorageUnitDao
focal_class.var_name: storageUnitDao
focal_class.declarator: storageUnitDaoHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private StorageUnitDaoHelper storageUnitDaoHelper;
focal_class.type: StorageUnitDaoHelper
focal_class.var_name: storageUnitDaoHelper
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/impl/BusinessObjectDataInitiateDestroyHelperServiceImpl.java
focal_class.identifier: BusinessObjectDataInitiateDestroyHelperServiceImpl
focal_class.interfaces: implements BusinessObjectDataInitiateDestroyHelperService
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.executeInitiateDestroyAfterStep(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.full_signature: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public BusinessObjectData executeInitiateDestroyAfterStep(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.identifier: executeInitiateDestroyAfterStep
focal_class.modifiers: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public
focal_class.parameters: (BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.return: BusinessObjectData
focal_class.signature: BusinessObjectData executeInitiateDestroyAfterStep(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.executeS3SpecificSteps(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.full_signature: @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public void executeS3SpecificSteps(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.identifier: executeS3SpecificSteps
focal_class.modifiers: @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public
focal_class.parameters: (BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.return: void
focal_class.signature: void executeS3SpecificSteps(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.prepareToInitiateDestroy(BusinessObjectDataDestroyDto businessObjectDataDestroyDto, BusinessObjectDataKey businessObjectDataKey)
focal_class.full_signature: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public void prepareToInitiateDestroy(BusinessObjectDataDestroyDto businessObjectDataDestroyDto, BusinessObjectDataKey businessObjectDataKey)
focal_class.identifier: prepareToInitiateDestroy
focal_class.modifiers: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public
focal_class.parameters: (BusinessObjectDataDestroyDto businessObjectDataDestroyDto, BusinessObjectDataKey businessObjectDataKey)
focal_class.return: void
focal_class.signature: void prepareToInitiateDestroy(BusinessObjectDataDestroyDto businessObjectDataDestroyDto, BusinessObjectDataKey businessObjectDataKey)
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.executeInitiateDestroyAfterStepImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.full_signature:  BusinessObjectData executeInitiateDestroyAfterStepImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.identifier: executeInitiateDestroyAfterStepImpl
focal_class.parameters: (BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.return: BusinessObjectData
focal_class.signature: BusinessObjectData executeInitiateDestroyAfterStepImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.executeS3SpecificStepsImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.full_signature:  void executeS3SpecificStepsImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.identifier: executeS3SpecificStepsImpl
focal_class.parameters: (BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.return: void
focal_class.signature: void executeS3SpecificStepsImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto)
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.getAndValidateFinalDestroyInDays()
focal_class.full_signature:  int getAndValidateFinalDestroyInDays()
focal_class.identifier: getAndValidateFinalDestroyInDays
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getAndValidateFinalDestroyInDays()
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.getAndValidateStorageUnit(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_class.full_signature:  StorageUnitEntity getAndValidateStorageUnit(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_class.identifier: getAndValidateStorageUnit
focal_class.parameters: (BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_class.return: StorageUnitEntity
focal_class.signature: StorageUnitEntity getAndValidateStorageUnit(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.prepareToInitiateDestroyImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto, BusinessObjectDataKey businessObjectDataKey)
focal_class.full_signature:  void prepareToInitiateDestroyImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto, BusinessObjectDataKey businessObjectDataKey)
focal_class.identifier: prepareToInitiateDestroyImpl
focal_class.parameters: (BusinessObjectDataDestroyDto businessObjectDataDestroyDto, BusinessObjectDataKey businessObjectDataKey)
focal_class.return: void
focal_class.signature: void prepareToInitiateDestroyImpl(BusinessObjectDataDestroyDto businessObjectDataDestroyDto, BusinessObjectDataKey businessObjectDataKey)
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.validateBusinessObjectData(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_class.full_signature:  void validateBusinessObjectData(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_class.identifier: validateBusinessObjectData
focal_class.parameters: (BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_class.return: void
focal_class.signature: void validateBusinessObjectData(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_class.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.validateStorage(StorageEntity storageEntity)
focal_class.full_signature:  void validateStorage(StorageEntity storageEntity)
focal_class.identifier: validateStorage
focal_class.parameters: (StorageEntity storageEntity)
focal_class.return: void
focal_class.signature: void validateStorage(StorageEntity storageEntity)
focal_method.body: StorageUnitEntity getAndValidateStorageUnit(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
      {
          // Retrieve all S3 storage units for this business object data.
          List<StorageUnitEntity> s3StorageUnitEntities =
              storageUnitDao.getStorageUnitsByStoragePlatformAndBusinessObjectData(StoragePlatformEntity.S3, businessObjectDataEntity);
  
          // Validate that business object data has at least one S3 storage unit.
          if (CollectionUtils.isEmpty(s3StorageUnitEntities))
          {
              throw new IllegalArgumentException(String.format("Business object data has no S3 storage unit. Business object data: {%s}",
                  businessObjectDataHelper.businessObjectDataKeyToString(businessObjectDataKey)));
          }
  
          // Validate that this business object data has no multiple S3 storage units.
          if (CollectionUtils.size(s3StorageUnitEntities) > 1)
          {
              throw new IllegalArgumentException(String
                  .format("Business object data has multiple (%s) %s storage units. Business object data: {%s}", s3StorageUnitEntities.size(),
                      StoragePlatformEntity.S3, businessObjectDataHelper.businessObjectDataKeyToString(businessObjectDataKey)));
          }
  
          // Get the S3 storage unit.
          StorageUnitEntity storageUnitEntity = s3StorageUnitEntities.get(0);
  
          // Get the storage unit status code.
          String storageUnitStatus = storageUnitEntity.getStatus().getCode();
  
          // Validate storage unit status.
          if (!BusinessObjectDataInitiateDestroyHelperServiceImpl.SUPPORTED_STORAGE_UNIT_STATUSES.contains(storageUnitStatus))
          {
              throw new IllegalArgumentException(String
                  .format("Storage unit status \"%s\" is not supported by the business object data destroy feature. Storage: {%s}, business object data: {%s}",
                      storageUnitStatus, storageUnitEntity.getStorage().getName(),
                      businessObjectDataHelper.businessObjectDataKeyToString(businessObjectDataKey)));
          }
  
          return storageUnitEntity;
      }
focal_method.class_method_signature: BusinessObjectDataInitiateDestroyHelperServiceImpl.getAndValidateStorageUnit(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_method.full_signature:  StorageUnitEntity getAndValidateStorageUnit(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_method.identifier: getAndValidateStorageUnit
focal_method.invocations: getStorageUnitsByStoragePlatformAndBusinessObjectData isEmpty format businessObjectDataKeyToString size format size businessObjectDataKeyToString get getCode getStatus contains format getName getStorage businessObjectDataKeyToString
focal_method.parameters: (BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)
focal_method.return: StorageUnitEntity
focal_method.signature: StorageUnitEntity getAndValidateStorageUnit(BusinessObjectDataEntity businessObjectDataEntity, BusinessObjectDataKey businessObjectDataKey)