StorageRestController extends HerdBaseController { @RequestMapping(value = STORAGE_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_STORAGES_POST) Storage createStorage(@RequestBody StorageCreateRequest storageCreateRequest) { return storageService.createStorage(storageCreateRequest); }    }
@Test public void testCreateStorage() { StorageCreateRequest storageCreateRequest = new StorageCreateRequest(STORAGE_NAME, STORAGE_PLATFORM_CODE, NO_ATTRIBUTES); Storage storage = new Storage(STORAGE_NAME, STORAGE_PLATFORM_CODE, NO_ATTRIBUTES); when(storageService.createStorage(storageCreateRequest)).thenReturn(storage); Storage result = storageRestController.createStorage(storageCreateRequest); verify(storageService).createStorage(storageCreateRequest); verifyNoMoreInteractions(storageService); assertEquals(storage, result); }