BusinessObjectDataFinalizeRestoreServiceImpl implements BusinessObjectDataFinalizeRestoreService { @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public List<BusinessObjectDataStorageUnitKey> getS3StorageUnitsToRestore(int maxResult) { return getS3StorageUnitsToRestoreImpl(maxResult); }  @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) void finalizeRestore(BusinessObjectDataStorageUnitKey storageUnitKey); @Override @Transactional(propagation = Propagation.REQUIRES_NEW) List<BusinessObjectDataStorageUnitKey> getS3StorageUnitsToRestore(int maxResult);  }
@Test public void testGetS3StorageUnitsToRestore() { StorageUnitEntity storageUnitEntity = new StorageUnitEntity(); List<StorageUnitEntity> storageUnitEntities = Arrays.asList(storageUnitEntity); 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); when(storageUnitDao.getS3StorageUnitsToRestore(MAX_RESULT)).thenReturn(storageUnitEntities); when(storageUnitHelper.createStorageUnitKeyFromEntity(storageUnitEntity)).thenReturn(storageUnitKey); List<BusinessObjectDataStorageUnitKey> result = businessObjectDataFinalizeRestoreServiceImpl.getS3StorageUnitsToRestore(MAX_RESULT); verify(storageUnitDao).getS3StorageUnitsToRestore(MAX_RESULT); verify(storageUnitHelper).createStorageUnitKeyFromEntity(storageUnitEntity); verifyNoMoreInteractionsHelper(); assertEquals(Arrays.asList(storageUnitKey), result); }