@Test public void deleteStorage() throws BusinessException { String id = "id"; restfulService.deleteStorage(id); ArgumentCaptor<StorageData> captor = ArgumentCaptor.forClass(StorageData.class); verify(storageService, times(1)).deleteStorage(captor.capture()); assertThat(captor.getValue().getId(), is(id)); }
@RequestMapping(method = GET, value = "{id}/delete") @ResponseBody public Object deleteStorage(@PathVariable String id) throws BusinessException { StorageData storageData = new StorageData(); storageData.setId(id); storageService.deleteStorage(storageData); return Collections.singletonMap("message", "Storage id " + id + " successfully deleted."); }
StorageRestfulService { @RequestMapping(method = GET, value = "{id}/delete") @ResponseBody public Object deleteStorage(@PathVariable String id) throws BusinessException { StorageData storageData = new StorageData(); storageData.setId(id); storageService.deleteStorage(storageData); return Collections.singletonMap("message", "Storage id " + id + " successfully deleted."); } }
StorageRestfulService { @RequestMapping(method = GET, value = "{id}/delete") @ResponseBody public Object deleteStorage(@PathVariable String id) throws BusinessException { StorageData storageData = new StorageData(); storageData.setId(id); storageService.deleteStorage(storageData); return Collections.singletonMap("message", "Storage id " + id + " successfully deleted."); }  }
StorageRestfulService { @RequestMapping(method = GET, value = "{id}/delete") @ResponseBody public Object deleteStorage(@PathVariable String id) throws BusinessException { StorageData storageData = new StorageData(); storageData.setId(id); storageService.deleteStorage(storageData); return Collections.singletonMap("message", "Storage id " + id + " successfully deleted."); }  @ExceptionHandler(Exception.class) ModelAndView handleAllException(Exception exception); @RequestMapping(method = GET, value = "") @ResponseBody List<StorageData> getAllStorages(); @RequestMapping(method = GET, value = "{id}") @ResponseBody StorageData getStorageById(@PathVariable String id); @RequestMapping(method = GET, value = "{name}/create") @ResponseBody Object createStorage(@PathVariable String name); @RequestMapping(method = GET, value = "{id}/finalize") @ResponseBody Object finalizeStorage(@PathVariable String id); @RequestMapping(method = GET, value = "{id}/delete") @ResponseBody Object deleteStorage(@PathVariable String id); @RequestMapping(method = GET, value = "state") @ResponseBody Map<String, Object> getRecordingState(); @RequestMapping(method = GET, value = "stop") @ResponseBody Object stopRecording(); @RequestMapping(method = RequestMethod.GET, value = "start") @ResponseBody Object startOrScheduleRecording(@RequestParam(value = "id", required = true) String id, @RequestParam(value = "startDelay", required = false) Long startDelay,
			@RequestParam(value = "recordingDuration", required = false) Long recordingDuration,
			@RequestParam(value = "extractInvocations", required = false, defaultValue = "true") Boolean extractInvocations,
			@RequestParam(value = "autoFinalize", required = false, defaultValue = "true") Boolean autoFinalize); @ModelAttribute void setVaryResponseHeader(HttpServletResponse response); }
StorageRestfulService { @RequestMapping(method = GET, value = "{id}/delete") @ResponseBody public Object deleteStorage(@PathVariable String id) throws BusinessException { StorageData storageData = new StorageData(); storageData.setId(id); storageService.deleteStorage(storageData); return Collections.singletonMap("message", "Storage id " + id + " successfully deleted."); }  @ExceptionHandler(Exception.class) ModelAndView handleAllException(Exception exception); @RequestMapping(method = GET, value = "") @ResponseBody List<StorageData> getAllStorages(); @RequestMapping(method = GET, value = "{id}") @ResponseBody StorageData getStorageById(@PathVariable String id); @RequestMapping(method = GET, value = "{name}/create") @ResponseBody Object createStorage(@PathVariable String name); @RequestMapping(method = GET, value = "{id}/finalize") @ResponseBody Object finalizeStorage(@PathVariable String id); @RequestMapping(method = GET, value = "{id}/delete") @ResponseBody Object deleteStorage(@PathVariable String id); @RequestMapping(method = GET, value = "state") @ResponseBody Map<String, Object> getRecordingState(); @RequestMapping(method = GET, value = "stop") @ResponseBody Object stopRecording(); @RequestMapping(method = RequestMethod.GET, value = "start") @ResponseBody Object startOrScheduleRecording(@RequestParam(value = "id", required = true) String id, @RequestParam(value = "startDelay", required = false) Long startDelay,
			@RequestParam(value = "recordingDuration", required = false) Long recordingDuration,
			@RequestParam(value = "extractInvocations", required = false, defaultValue = "true") Boolean extractInvocations,
			@RequestParam(value = "autoFinalize", required = false, defaultValue = "true") Boolean autoFinalize); @ModelAttribute void setVaryResponseHeader(HttpServletResponse response);  }