StorageRestController extends HerdBaseController { @RequestMapping(value = STORAGE_URI_PREFIX + "/{storageName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGES_GET) Storage getStorage(@PathVariable("storageName") String storageName) { return storageService.getStorage(new StorageKey(storageName)); }    }
@Test public void testGetStorage() { StorageKey storageKey = new StorageKey(STORAGE_NAME); Storage storage = new Storage(STORAGE_NAME, STORAGE_PLATFORM_CODE, NO_ATTRIBUTES); when(storageService.getStorage(storageKey)).thenReturn(storage); Storage result = storageRestController.getStorage(STORAGE_NAME); verify(storageService).getStorage(storageKey); verifyNoMoreInteractions(storageService); assertEquals(storage, result); }