CleanupDestroyedBusinessObjectDataServiceImpl implements CleanupDestroyedBusinessObjectDataService { @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) public List<BusinessObjectDataStorageUnitKey> getS3StorageUnitsToCleanup(int maxResult) { return getS3StorageUnitsToCleanupImpl(maxResult); }  @PublishNotificationMessages @Override @Transactional(propagation = Propagation.REQUIRES_NEW) void cleanupS3StorageUnit(BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey); @Override @Transactional(propagation = Propagation.NOT_SUPPORTED) List<BusinessObjectDataStorageUnitKey> getS3StorageUnitsToCleanup(int maxResult);  }
@Test public void testGetS3StorageUnitsToCleanup() { StorageUnitEntity storageUnitEntity = new StorageUnitEntity(); List<StorageUnitEntity> storageUnitEntities = Collections.singletonList(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(mockStorageUnitDao.getS3StorageUnitsToCleanup(MAX_RESULT)).thenReturn(storageUnitEntities); when(mockStorageUnitHelper.createStorageUnitKeyFromEntity(storageUnitEntity)).thenReturn(storageUnitKey); List<BusinessObjectDataStorageUnitKey> result = cleanupDestroyedBusinessObjectDataService.getS3StorageUnitsToCleanup(MAX_RESULT); verify(mockStorageUnitDao).getS3StorageUnitsToCleanup(MAX_RESULT); verify(mockStorageUnitHelper).createStorageUnitKeyFromEntity(storageUnitEntity); verifyNoMoreInteractionsHelper(); assertEquals(Collections.singletonList(storageUnitKey), result); }