StorageUnitDaoHelper { public void setStorageUnitStatus(StorageUnitEntity storageUnitEntity, StorageUnitStatusEntity storageUnitStatusEntity) { storageUnitEntity.setStatus(storageUnitStatusEntity); messageNotificationEventService .processStorageUnitStatusChangeNotificationEvent(businessObjectDataHelper.getBusinessObjectDataKey(storageUnitEntity.getBusinessObjectData()), storageUnitEntity.getStorage().getName(), storageUnitStatusEntity.getCode(), null); }  StorageUnitEntity findExplicitlyRegisteredSubPartitionInStorageForBusinessObjectData(StorageEntity storageEntity,
        BusinessObjectFormatEntity businessObjectFormatEntity, BusinessObjectFormat businessObjectFormat, BusinessObjectDataKey businessObjectDataKey); StorageUnitEntity getStorageUnitEntity(String storageName, BusinessObjectDataEntity businessObjectDataEntity); StorageUnitEntity getStorageUnitEntityByBusinessObjectDataAndStorage(BusinessObjectDataEntity businessObjectDataEntity, StorageEntity storageEntity); StorageUnitEntity getStorageUnitEntityByKey(BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey); void setStorageUnitStatus(StorageUnitEntity storageUnitEntity, StorageUnitStatusEntity storageUnitStatusEntity); void updateStorageUnitStatus(StorageUnitEntity storageUnitEntity, String storageUnitStatus, String reason); void updateStorageUnitStatus(StorageUnitEntity storageUnitEntity, StorageUnitStatusEntity storageUnitStatusEntity, String reason); void validateNoExplicitlyRegisteredSubPartitionInStorageForBusinessObjectData(StorageEntity storageEntity,
        BusinessObjectFormatEntity businessObjectFormatEntity, BusinessObjectDataKey businessObjectDataKey, String s3KeyPrefix);  }
@Test public void testSetStorageUnitStatus() { BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION); BusinessObjectDataEntity businessObjectDataEntity = new BusinessObjectDataEntity(); StorageEntity storageEntity = new StorageEntity(); storageEntity.setName(STORAGE_NAME); StorageUnitEntity storageUnitEntity = new StorageUnitEntity(); storageUnitEntity.setBusinessObjectData(businessObjectDataEntity); storageUnitEntity.setStorage(storageEntity); StorageUnitStatusEntity storageUnitStatusEntity = new StorageUnitStatusEntity(); storageUnitStatusEntity.setCode(STORAGE_UNIT_STATUS); when(businessObjectDataHelper.getBusinessObjectDataKey(businessObjectDataEntity)).thenReturn(businessObjectDataKey); storageUnitDaoHelper.setStorageUnitStatus(storageUnitEntity, storageUnitStatusEntity); assertEquals(STORAGE_UNIT_STATUS, storageUnitEntity.getStatus().getCode()); verify(businessObjectDataHelper).getBusinessObjectDataKey(businessObjectDataEntity); verify(messageNotificationEventService) .processStorageUnitStatusChangeNotificationEvent(businessObjectDataKey, STORAGE_NAME, STORAGE_UNIT_STATUS, NO_STORAGE_UNIT_STATUS); verifyNoMoreInteractionsHelper(); }