StorageRestController extends HerdBaseController { @RequestMapping(value = "/storageAttributes/storages/{storageName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_STORAGE_ATTRIBUTES_PUT) Storage updateStorageAttributes(@PathVariable("storageName") String storageName, @RequestBody StorageAttributesUpdateRequest storageAttributesUpdateRequest) { return storageService.updateStorageAttributes(new StorageKey(storageName), storageAttributesUpdateRequest); }    }
@Test public void testUpdateStorageAttributes() { StorageKey storageKey = new StorageKey(STORAGE_NAME); StorageAttributesUpdateRequest storageAttributesUpdateRequest = new StorageAttributesUpdateRequest(businessObjectDefinitionServiceTestHelper.getNewAttributes()); Storage storage = new Storage(STORAGE_NAME, STORAGE_PLATFORM_CODE, businessObjectDefinitionServiceTestHelper.getNewAttributes()); when(storageService.updateStorageAttributes(storageKey, storageAttributesUpdateRequest)).thenReturn(storage); Storage result = storageRestController.updateStorageAttributes(STORAGE_NAME, storageAttributesUpdateRequest); verify(storageService).updateStorageAttributes(storageKey, storageAttributesUpdateRequest); verifyNoMoreInteractions(storageService); assertEquals(storage, result); }