@Test void testUpdateResource() throws Exception { String json = "{\"resource\":{\"id\":\"p0\",\"type\":\"PACKAGE\",\"label\":\"label\",\"description\":\"description\"}}"; mockMvc .perform( put(NavigatorController.URI + "/update").content(json).contentType(APPLICATION_JSON)) .andExpect(status().isOk()); verify(navigatorService) .updateResource( Resource.builder() .setType(ResourceType.PACKAGE) .setId("p0") .setLabel("label") .setDescription("description") .build()); }
@PutMapping("/update") @ResponseStatus(OK) public void updateResource(@RequestBody @Valid UpdateResourceRequest updateResourceRequest) { navigatorService.updateResource(updateResourceRequest.getResource()); }
NavigatorController extends PluginController { @PutMapping("/update") @ResponseStatus(OK) public void updateResource(@RequestBody @Valid UpdateResourceRequest updateResourceRequest) { navigatorService.updateResource(updateResourceRequest.getResource()); } }
NavigatorController extends PluginController { @PutMapping("/update") @ResponseStatus(OK) public void updateResource(@RequestBody @Valid UpdateResourceRequest updateResourceRequest) { navigatorService.updateResource(updateResourceRequest.getResource()); } NavigatorController(MenuReaderService menuReaderService, NavigatorService navigatorService); }
NavigatorController extends PluginController { @PutMapping("/update") @ResponseStatus(OK) public void updateResource(@RequestBody @Valid UpdateResourceRequest updateResourceRequest) { navigatorService.updateResource(updateResourceRequest.getResource()); } NavigatorController(MenuReaderService menuReaderService, NavigatorService navigatorService); @GetMapping("/**") String init(Model model); @GetMapping("/get") @ResponseBody GetResourcesResponse getResources(
      @RequestParam(value = "folderId", required = false) @Nullable @CheckForNull String folderId); @GetMapping("/search") @ResponseBody SearchResourcesResponse searchResources(@RequestParam(value = "query") String query); @PutMapping("/update") @ResponseStatus(OK) void updateResource(@RequestBody @Valid UpdateResourceRequest updateResourceRequest); @PostMapping("/copy") @ResponseBody JobExecution copyResources(@RequestBody @Valid CopyResourcesRequest copyResourcesRequest); @PostMapping("/download") @ResponseBody JobExecution downloadResources(
      @RequestBody @Valid DownloadResourcesRequest downloadResourcesRequest); @PostMapping("/move") @ResponseStatus(OK) void moveResources(@RequestBody @Valid MoveResourcesRequest moveResourcesRequest); @DeleteMapping("/delete") @ResponseBody JobExecution deleteResources(
      @RequestBody @Valid DeleteResourcesRequest deleteItemsRequest); }
NavigatorController extends PluginController { @PutMapping("/update") @ResponseStatus(OK) public void updateResource(@RequestBody @Valid UpdateResourceRequest updateResourceRequest) { navigatorService.updateResource(updateResourceRequest.getResource()); } NavigatorController(MenuReaderService menuReaderService, NavigatorService navigatorService); @GetMapping("/**") String init(Model model); @GetMapping("/get") @ResponseBody GetResourcesResponse getResources(
      @RequestParam(value = "folderId", required = false) @Nullable @CheckForNull String folderId); @GetMapping("/search") @ResponseBody SearchResourcesResponse searchResources(@RequestParam(value = "query") String query); @PutMapping("/update") @ResponseStatus(OK) void updateResource(@RequestBody @Valid UpdateResourceRequest updateResourceRequest); @PostMapping("/copy") @ResponseBody JobExecution copyResources(@RequestBody @Valid CopyResourcesRequest copyResourcesRequest); @PostMapping("/download") @ResponseBody JobExecution downloadResources(
      @RequestBody @Valid DownloadResourcesRequest downloadResourcesRequest); @PostMapping("/move") @ResponseStatus(OK) void moveResources(@RequestBody @Valid MoveResourcesRequest moveResourcesRequest); @DeleteMapping("/delete") @ResponseBody JobExecution deleteResources(
      @RequestBody @Valid DeleteResourcesRequest deleteItemsRequest); static final String ID; static final String URI; }