test_class.declarator: businessObjectDataFinalizeRestoreHelperService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private BusinessObjectDataFinalizeRestoreHelperService businessObjectDataFinalizeRestoreHelperService;
test_class.type: BusinessObjectDataFinalizeRestoreHelperService
test_class.var_name: businessObjectDataFinalizeRestoreHelperService
test_class.declarator: businessObjectDataFinalizeRestoreServiceImpl
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private BusinessObjectDataFinalizeRestoreServiceImpl businessObjectDataFinalizeRestoreServiceImpl;
test_class.type: BusinessObjectDataFinalizeRestoreServiceImpl
test_class.var_name: businessObjectDataFinalizeRestoreServiceImpl
test_class.declarator: notificationEventService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private NotificationEventService notificationEventService;
test_class.type: NotificationEventService
test_class.var_name: notificationEventService
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: storageUnitHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private StorageUnitHelper storageUnitHelper;
test_class.type: StorageUnitHelper
test_class.var_name: storageUnitHelper
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/impl/BusinessObjectDataFinalizeRestoreServiceImplTest.java
test_class.identifier: BusinessObjectDataFinalizeRestoreServiceImplTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testFinalizeRestore()
      {
          // 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 DTO for business object data restore parameters.
          BusinessObjectDataRestoreDto businessObjectDataRestoreDto =
              new BusinessObjectDataRestoreDto(businessObjectDataKey, STORAGE_NAME, S3_ENDPOINT, S3_BUCKET_NAME, S3_KEY_PREFIX, NO_STORAGE_UNIT_STATUS,
                  NO_STORAGE_UNIT_STATUS, Arrays.asList(new StorageFile(S3_KEY, FILE_SIZE, ROW_COUNT)), NO_EXCEPTION, ARCHIVE_RETRIEVAL_OPTION);
  
          // Mock the external calls.
          when(businessObjectDataFinalizeRestoreHelperService.prepareToFinalizeRestore(storageUnitKey)).thenReturn(businessObjectDataRestoreDto);
          doAnswer(new Answer<Void>()
          {
              public Void answer(InvocationOnMock invocation)
              {
                  // Get the parameters DTO for the business object data restore.
                  BusinessObjectDataRestoreDto businessObjectDataRestoreDto = (BusinessObjectDataRestoreDto) invocation.getArguments()[0];
  
                  //Set the value for the new and old storage unit statuses.
                  businessObjectDataRestoreDto.setNewStorageUnitStatus(StorageUnitStatusEntity.RESTORED);
                  businessObjectDataRestoreDto.setOldStorageUnitStatus(StorageUnitStatusEntity.RESTORING);
  
                  return null;
              }
          }).when(businessObjectDataFinalizeRestoreHelperService).completeFinalizeRestore(businessObjectDataRestoreDto);
  
          // Call the method under test.
          businessObjectDataFinalizeRestoreServiceImpl.finalizeRestore(storageUnitKey);
  
          // Verify the external calls.
          verify(businessObjectDataFinalizeRestoreHelperService).prepareToFinalizeRestore(storageUnitKey);
          verify(businessObjectDataFinalizeRestoreHelperService).executeS3SpecificSteps(businessObjectDataRestoreDto);
          verify(businessObjectDataFinalizeRestoreHelperService).completeFinalizeRestore(businessObjectDataRestoreDto);
          verify(notificationEventService)
              .processStorageUnitNotificationEventAsync(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG, businessObjectDataKey,
                  STORAGE_NAME, StorageUnitStatusEntity.RESTORED, StorageUnitStatusEntity.RESTORING);
          verifyNoMoreInteractionsHelper();
      }
test_case.class_method_signature: BusinessObjectDataFinalizeRestoreServiceImplTest.testFinalizeRestore()
test_case.full_signature: @Test public void testFinalizeRestore()
test_case.identifier: testFinalizeRestore
test_case.invocations: asList thenReturn when prepareToFinalizeRestore completeFinalizeRestore when doAnswer getArguments setNewStorageUnitStatus setOldStorageUnitStatus finalizeRestore prepareToFinalizeRestore verify executeS3SpecificSteps verify completeFinalizeRestore verify processStorageUnitNotificationEventAsync verify verifyNoMoreInteractionsHelper
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFinalizeRestore()
focal_class.declarator: businessObjectDataFinalizeRestoreHelperService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectDataFinalizeRestoreHelperService businessObjectDataFinalizeRestoreHelperService;
focal_class.type: BusinessObjectDataFinalizeRestoreHelperService
focal_class.var_name: businessObjectDataFinalizeRestoreHelperService
focal_class.declarator: notificationEventService
focal_class.modifier: @Autowired
      @Lazy
      private
focal_class.original_string: @Autowired
      @Lazy
      private NotificationEventService notificationEventService;
focal_class.type: NotificationEventService
focal_class.var_name: notificationEventService
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: storageUnitHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private StorageUnitHelper storageUnitHelper;
focal_class.type: StorageUnitHelper
focal_class.var_name: storageUnitHelper
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/impl/BusinessObjectDataFinalizeRestoreServiceImpl.java
focal_class.identifier: BusinessObjectDataFinalizeRestoreServiceImpl
focal_class.interfaces: implements BusinessObjectDataFinalizeRestoreService
focal_class.class_method_signature: BusinessObjectDataFinalizeRestoreServiceImpl.finalizeRestore(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.full_signature: @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public void finalizeRestore(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.identifier: finalizeRestore
focal_class.modifiers: @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public
focal_class.parameters: (BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.return: void
focal_class.signature: void finalizeRestore(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.class_method_signature: BusinessObjectDataFinalizeRestoreServiceImpl.getS3StorageUnitsToRestore(int maxResult)
focal_class.full_signature: @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public List<BusinessObjectDataStorageUnitKey> getS3StorageUnitsToRestore(int maxResult)
focal_class.identifier: getS3StorageUnitsToRestore
focal_class.modifiers: @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public
focal_class.parameters: (int maxResult)
focal_class.return: List<BusinessObjectDataStorageUnitKey>
focal_class.signature: List<BusinessObjectDataStorageUnitKey> getS3StorageUnitsToRestore(int maxResult)
focal_class.class_method_signature: BusinessObjectDataFinalizeRestoreServiceImpl.finalizeRestoreImpl(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.full_signature: protected void finalizeRestoreImpl(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.identifier: finalizeRestoreImpl
focal_class.modifiers: protected
focal_class.parameters: (BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.return: void
focal_class.signature: void finalizeRestoreImpl(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_class.class_method_signature: BusinessObjectDataFinalizeRestoreServiceImpl.getS3StorageUnitsToRestoreImpl(int maxResult)
focal_class.full_signature: protected List<BusinessObjectDataStorageUnitKey> getS3StorageUnitsToRestoreImpl(int maxResult)
focal_class.identifier: getS3StorageUnitsToRestoreImpl
focal_class.modifiers: protected
focal_class.parameters: (int maxResult)
focal_class.return: List<BusinessObjectDataStorageUnitKey>
focal_class.signature: List<BusinessObjectDataStorageUnitKey> getS3StorageUnitsToRestoreImpl(int maxResult)
focal_method.body: @Override
      @Transactional(propagation = Propagation.NOT_SUPPORTED)
      public void finalizeRestore(BusinessObjectDataStorageUnitKey storageUnitKey)
      {
          finalizeRestoreImpl(storageUnitKey);
      }
focal_method.class_method_signature: BusinessObjectDataFinalizeRestoreServiceImpl.finalizeRestore(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_method.full_signature: @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public void finalizeRestore(BusinessObjectDataStorageUnitKey storageUnitKey)
focal_method.identifier: finalizeRestore
focal_method.invocations: finalizeRestoreImpl
focal_method.modifiers: @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public
focal_method.parameters: (BusinessObjectDataStorageUnitKey storageUnitKey)
focal_method.return: void
focal_method.signature: void finalizeRestore(BusinessObjectDataStorageUnitKey storageUnitKey)