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: 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: expireRestoredBusinessObjectDataHelperServiceImpl
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private ExpireRestoredBusinessObjectDataHelperServiceImpl expireRestoredBusinessObjectDataHelperServiceImpl;
test_class.type: ExpireRestoredBusinessObjectDataHelperServiceImpl
test_class.var_name: expireRestoredBusinessObjectDataHelperServiceImpl
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: 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/ExpireRestoredBusinessObjectDataHelperServiceImplTest.java
test_class.identifier: ExpireRestoredBusinessObjectDataHelperServiceImplTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testPrepareToExpireStorageUnit()
      {
          // 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, SUBPARTITION_VALUES,
                  DATA_VERSION);
  
          // Create a storage unit key.
          BusinessObjectDataStorageUnitKey storageUnitKey =
              new BusinessObjectDataStorageUnitKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE,
                  SUBPARTITION_VALUES, DATA_VERSION, STORAGE_NAME);
  
          // Create a storage entity.
          StorageEntity storageEntity = new StorageEntity();
          storageEntity.setName(STORAGE_NAME);
  
          // Create a business object format entity.
          BusinessObjectFormatEntity businessObjectFormatEntity = new BusinessObjectFormatEntity();
  
          // Create a business object data entity.
          BusinessObjectDataEntity businessObjectDataEntity = new BusinessObjectDataEntity();
          businessObjectDataEntity.setBusinessObjectFormat(businessObjectFormatEntity);
  
          // Create a new storage unit status entity.
          StorageUnitStatusEntity newStorageUnitStatusEntity = new StorageUnitStatusEntity();
          newStorageUnitStatusEntity.setCode(StorageUnitStatusEntity.EXPIRING);
  
          // Create an old storage unit status entity.
          StorageUnitStatusEntity oldStorageUnitStatusEntity = new StorageUnitStatusEntity();
          oldStorageUnitStatusEntity.setCode(StorageUnitStatusEntity.RESTORED);
  
          // Create a list of storage file entities.
          List<StorageFileEntity> storageFileEntities = Arrays.asList(new StorageFileEntity());
  
          // Create a storage unit entity.
          StorageUnitEntity storageUnitEntity = new StorageUnitEntity();
          storageUnitEntity.setStorage(storageEntity);
          storageUnitEntity.setBusinessObjectData(businessObjectDataEntity);
          storageUnitEntity.setStatus(oldStorageUnitStatusEntity);
          storageUnitEntity.setStorageFiles(storageFileEntities);
  
          // Create a list of storage files.
          List<StorageFile> storageFiles = Arrays.asList(new StorageFile(S3_KEY, FILE_SIZE, ROW_COUNT));
  
          // Mock the external calls.
          when(businessObjectDataHelper.createBusinessObjectDataKeyFromStorageUnitKey(storageUnitKey)).thenReturn(businessObjectDataKey);
          when(businessObjectDataDaoHelper.getBusinessObjectDataEntity(businessObjectDataKey)).thenReturn(businessObjectDataEntity);
          when(storageUnitDaoHelper.getStorageUnitEntity(STORAGE_NAME, businessObjectDataEntity)).thenReturn(storageUnitEntity);
          when(configurationHelper.getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_BUCKET_NAME)).thenReturn(S3_ATTRIBUTE_NAME_BUCKET_NAME);
          when(storageHelper.getStorageAttributeValueByName(S3_ATTRIBUTE_NAME_BUCKET_NAME, storageEntity, true)).thenReturn(S3_BUCKET_NAME);
          when(s3KeyPrefixHelper.buildS3KeyPrefix(storageEntity, businessObjectFormatEntity, businessObjectDataKey)).thenReturn(S3_KEY_PREFIX);
          when(storageFileHelper.getAndValidateStorageFiles(storageUnitEntity, S3_KEY_PREFIX, STORAGE_NAME, businessObjectDataKey)).thenReturn(storageFiles);
          doAnswer(new Answer<Void>()
          {
              public Void answer(InvocationOnMock invocation)
              {
                  // Get the storage unit entity.
                  StorageUnitEntity storageUnitEntity = (StorageUnitEntity) invocation.getArguments()[0];
                  // Update the storage unit status.
                  storageUnitEntity.setStatus(newStorageUnitStatusEntity);
                  return null;
              }
          }).when(storageUnitDaoHelper).updateStorageUnitStatus(storageUnitEntity, StorageUnitStatusEntity.EXPIRING, StorageUnitStatusEntity.EXPIRING);
          when(configurationHelper.getProperty(ConfigurationValue.S3_ENDPOINT)).thenReturn(S3_ENDPOINT);
  
          // Call the method under test.
          BusinessObjectDataRestoreDto result = expireRestoredBusinessObjectDataHelperServiceImpl.prepareToExpireStorageUnit(storageUnitKey);
  
          // Verify the external calls.
          verify(businessObjectDataHelper).createBusinessObjectDataKeyFromStorageUnitKey(storageUnitKey);
          verify(businessObjectDataDaoHelper).getBusinessObjectDataEntity(businessObjectDataKey);
          verify(storageUnitDaoHelper).getStorageUnitEntity(STORAGE_NAME, businessObjectDataEntity);
          verify(configurationHelper).getProperty(ConfigurationValue.S3_ATTRIBUTE_NAME_BUCKET_NAME);
          verify(storageHelper).getStorageAttributeValueByName(S3_ATTRIBUTE_NAME_BUCKET_NAME, storageEntity, true);
          verify(s3KeyPrefixHelper).buildS3KeyPrefix(storageEntity, businessObjectFormatEntity, businessObjectDataKey);
          verify(storageFileHelper).getAndValidateStorageFiles(storageUnitEntity, S3_KEY_PREFIX, STORAGE_NAME, businessObjectDataKey);
          verify(storageUnitDaoHelper)
              .validateNoExplicitlyRegisteredSubPartitionInStorageForBusinessObjectData(storageEntity, businessObjectFormatEntity, businessObjectDataKey,
                  S3_KEY_PREFIX);
          verify(storageUnitDaoHelper).updateStorageUnitStatus(storageUnitEntity, StorageUnitStatusEntity.EXPIRING, StorageUnitStatusEntity.EXPIRING);
          verify(configurationHelper).getProperty(ConfigurationValue.S3_ENDPOINT);
          verifyNoMoreInteractionsHelper();
  
          // Validate the result.
          assertEquals(
              new BusinessObjectDataRestoreDto(businessObjectDataKey, STORAGE_NAME, S3_ENDPOINT, S3_BUCKET_NAME, S3_KEY_PREFIX, StorageUnitStatusEntity.EXPIRING,
                  StorageUnitStatusEntity.RESTORED, storageFiles, NO_EXCEPTION, null), result);
      }
test_case.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImplTest.testPrepareToExpireStorageUnit()
test_case.full_signature: @Test public void testPrepareToExpireStorageUnit()
test_case.identifier: testPrepareToExpireStorageUnit
test_case.invocations: setName setBusinessObjectFormat setCode setCode asList setStorage setBusinessObjectData setStatus setStorageFiles asList thenReturn when createBusinessObjectDataKeyFromStorageUnitKey thenReturn when getBusinessObjectDataEntity thenReturn when getStorageUnitEntity thenReturn when getProperty thenReturn when getStorageAttributeValueByName thenReturn when buildS3KeyPrefix thenReturn when getAndValidateStorageFiles updateStorageUnitStatus when doAnswer getArguments setStatus thenReturn when getProperty prepareToExpireStorageUnit createBusinessObjectDataKeyFromStorageUnitKey verify getBusinessObjectDataEntity verify getStorageUnitEntity verify getProperty verify getStorageAttributeValueByName verify buildS3KeyPrefix verify getAndValidateStorageFiles verify validateNoExplicitlyRegisteredSubPartitionInStorageForBusinessObjectData verify updateStorageUnitStatus verify getProperty verify verifyNoMoreInteractionsHelper assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPrepareToExpireStorageUnit()
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: 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: 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: 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/ExpireRestoredBusinessObjectDataHelperServiceImpl.java
focal_class.identifier: ExpireRestoredBusinessObjectDataHelperServiceImpl
focal_class.interfaces: implements ExpireRestoredBusinessObjectDataHelperService
focal_class.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImpl.completeStorageUnitExpiration(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.full_signature: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public void completeStorageUnitExpiration(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.identifier: completeStorageUnitExpiration
focal_class.modifiers: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public
focal_class.parameters: (BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.return: void
focal_class.signature: void completeStorageUnitExpiration(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImpl.executeS3SpecificSteps(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.full_signature: @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public void executeS3SpecificSteps(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.identifier: executeS3SpecificSteps
focal_class.modifiers: @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public
focal_class.parameters: (BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.return: void
focal_class.signature: void executeS3SpecificSteps(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImpl.prepareToExpireStorageUnit(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.full_signature: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public BusinessObjectDataRestoreDto prepareToExpireStorageUnit(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.identifier: prepareToExpireStorageUnit
focal_class.modifiers: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public
focal_class.parameters: (BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.return: BusinessObjectDataRestoreDto
focal_class.signature: BusinessObjectDataRestoreDto prepareToExpireStorageUnit(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImpl.completeStorageUnitExpirationImpl(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.full_signature: protected void completeStorageUnitExpirationImpl(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.identifier: completeStorageUnitExpirationImpl
focal_class.modifiers: protected
focal_class.parameters: (BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.return: void
focal_class.signature: void completeStorageUnitExpirationImpl(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImpl.executeS3SpecificStepsImpl(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.full_signature: protected void executeS3SpecificStepsImpl(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.identifier: executeS3SpecificStepsImpl
focal_class.modifiers: protected
focal_class.parameters: (BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.return: void
focal_class.signature: void executeS3SpecificStepsImpl(BusinessObjectDataRestoreDto businessObjectDataRestoreDto)
focal_class.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImpl.getStorageUnit(String storageName, BusinessObjectDataEntity businessObjectDataEntity)
focal_class.full_signature: protected StorageUnitEntity getStorageUnit(String storageName, BusinessObjectDataEntity businessObjectDataEntity)
focal_class.identifier: getStorageUnit
focal_class.modifiers: protected
focal_class.parameters: (String storageName, BusinessObjectDataEntity businessObjectDataEntity)
focal_class.return: StorageUnitEntity
focal_class.signature: StorageUnitEntity getStorageUnit(String storageName, BusinessObjectDataEntity businessObjectDataEntity)
focal_class.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImpl.prepareToExpireStorageUnitImpl(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.full_signature: protected BusinessObjectDataRestoreDto prepareToExpireStorageUnitImpl(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.identifier: prepareToExpireStorageUnitImpl
focal_class.modifiers: protected
focal_class.parameters: (BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.return: BusinessObjectDataRestoreDto
focal_class.signature: BusinessObjectDataRestoreDto prepareToExpireStorageUnitImpl(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_method.body: @PublishNotificationMessages
      @Override
      @Transactional(propagation = Propagation.REQUIRES_NEW)
      public BusinessObjectDataRestoreDto prepareToExpireStorageUnit(BusinessObjectDataStorageUnitKey storageUnitKey)
      {
          return prepareToExpireStorageUnitImpl(storageUnitKey);
      }
focal_method.class_method_signature: ExpireRestoredBusinessObjectDataHelperServiceImpl.prepareToExpireStorageUnit(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_method.full_signature: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public BusinessObjectDataRestoreDto prepareToExpireStorageUnit(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_method.identifier: prepareToExpireStorageUnit
focal_method.invocations: prepareToExpireStorageUnitImpl
focal_method.modifiers: @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public
focal_method.parameters: (BusinessObjectDataStorageUnitKey storageUnitKey)
focal_method.return: BusinessObjectDataRestoreDto
focal_method.signature: BusinessObjectDataRestoreDto prepareToExpireStorageUnit(BusinessObjectDataStorageUnitKey storageUnitKey)