BusinessObjectDataStorageUnitStatusServiceImpl implements BusinessObjectDataStorageUnitStatusService { protected BusinessObjectDataStorageUnitStatusUpdateResponse updateBusinessObjectDataStorageUnitStatusImpl( BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey, BusinessObjectDataStorageUnitStatusUpdateRequest request) { storageUnitHelper.validateBusinessObjectDataStorageUnitKey(businessObjectDataStorageUnitKey); Assert.hasText(request.getStatus(), "A business object data storage unit status must be specified."); request.setStatus(request.getStatus().trim()); StorageUnitEntity storageUnitEntity = storageUnitDaoHelper.getStorageUnitEntityByKey(businessObjectDataStorageUnitKey); StorageUnitStatusEntity newStorageUnitStatusEntity = storageUnitStatusDaoHelper.getStorageUnitStatusEntity(request.getStatus()); String oldStorageUnitStatus = storageUnitEntity.getStatus().getCode(); storageUnitDaoHelper.updateStorageUnitStatus(storageUnitEntity, newStorageUnitStatusEntity, request.getStatus()); BusinessObjectDataKey businessObjectDataKey = businessObjectDataHelper.createBusinessObjectDataKeyFromEntity(storageUnitEntity.getBusinessObjectData()); BusinessObjectDataStorageUnitStatusUpdateResponse response = new BusinessObjectDataStorageUnitStatusUpdateResponse(); response.setBusinessObjectDataStorageUnitKey( storageUnitHelper.createBusinessObjectDataStorageUnitKey(businessObjectDataKey, storageUnitEntity.getStorage().getName())); response.setStatus(storageUnitEntity.getStatus().getCode()); response.setPreviousStatus(oldStorageUnitStatus); return response; }  @PublishNotificationMessages @NamespacePermission(fields = "#businessObjectDataStorageUnitKey.namespace", permissions = NamespacePermissionEnum.WRITE) @Override @Transactional(propagation = Propagation.REQUIRES_NEW) BusinessObjectDataStorageUnitStatusUpdateResponse updateBusinessObjectDataStorageUnitStatus(
        BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey, BusinessObjectDataStorageUnitStatusUpdateRequest request);  }
@Test public void testUpdateBusinessObjectDataStorageUnitStatusImplMissingStorageUnitStatus() { BusinessObjectDataStorageUnitKey businessObjectDataStorageUnitKey = new BusinessObjectDataStorageUnitKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, STORAGE_NAME); try { businessObjectDataStorageUnitStatusServiceImpl.updateBusinessObjectDataStorageUnitStatusImpl(businessObjectDataStorageUnitKey, new BusinessObjectDataStorageUnitStatusUpdateRequest(BLANK_TEXT)); fail(); } catch (IllegalArgumentException e) { assertEquals("A business object data storage unit status must be specified.", e.getMessage()); } verify(storageUnitHelper).validateBusinessObjectDataStorageUnitKey(businessObjectDataStorageUnitKey); verifyNoMoreInteractionsHelper(); }