StorageRestController extends HerdBaseController { @RequestMapping(value = STORAGE_URI_PREFIX + "/{storageName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_STORAGES_PUT) Storage updateStorage(@PathVariable("storageName") String storageName, @RequestBody StorageUpdateRequest storageUpdateRequest) { return storageService.updateStorage(new StorageKey(storageName), storageUpdateRequest); }    }
@Test public void testUpdateStorage() { StorageKey storageKey = new StorageKey(STORAGE_NAME); StorageUpdateRequest storageUpdateRequest = new StorageUpdateRequest(); Storage storage = new Storage(STORAGE_NAME, STORAGE_PLATFORM_CODE, NO_ATTRIBUTES); when(storageService.updateStorage(storageKey, storageUpdateRequest)).thenReturn(storage); Storage result = storageRestController.updateStorage(STORAGE_NAME, storageUpdateRequest); verify(storageService).updateStorage(storageKey, storageUpdateRequest); verifyNoMoreInteractions(storageService); assertEquals(storage, result); }