@Test void testDelete() throws Exception { String json = "{\"resources\": [{\"type\": \"PACKAGE\", \"id\": \"p0\"},{\"type\": \"PACKAGE\", \"id\": \"p1\"},{\"type\": \"ENTITY_TYPE\", \"id\": \"e0\"},{\"type\": \"ENTITY_TYPE\", \"id\": \"e1\"}]}"; mockMvc .perform( delete(NavigatorController.URI + "/delete").content(json).contentType(APPLICATION_JSON)) .andExpect(status().isOk()); verify(navigatorService) .deleteResources( asList( ResourceIdentifier.builder().setType(ResourceType.PACKAGE).setId("p0").build(), ResourceIdentifier.builder().setType(ResourceType.PACKAGE).setId("p1").build(), ResourceIdentifier.builder().setType(ResourceType.ENTITY_TYPE).setId("e0").build(), ResourceIdentifier.builder() .setType(ResourceType.ENTITY_TYPE) .setId("e1") .build())); }
@DeleteMapping("/delete") @ResponseBody public JobExecution deleteResources( @RequestBody @Valid DeleteResourcesRequest deleteItemsRequest) { return navigatorService.deleteResources(deleteItemsRequest.getResources()); }
NavigatorController extends PluginController { @DeleteMapping("/delete") @ResponseBody public JobExecution deleteResources( @RequestBody @Valid DeleteResourcesRequest deleteItemsRequest) { return navigatorService.deleteResources(deleteItemsRequest.getResources()); } }
NavigatorController extends PluginController { @DeleteMapping("/delete") @ResponseBody public JobExecution deleteResources( @RequestBody @Valid DeleteResourcesRequest deleteItemsRequest) { return navigatorService.deleteResources(deleteItemsRequest.getResources()); } NavigatorController(MenuReaderService menuReaderService, NavigatorService navigatorService); }
NavigatorController extends PluginController { @DeleteMapping("/delete") @ResponseBody public JobExecution deleteResources( @RequestBody @Valid DeleteResourcesRequest deleteItemsRequest) { return navigatorService.deleteResources(deleteItemsRequest.getResources()); } 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 { @DeleteMapping("/delete") @ResponseBody public JobExecution deleteResources( @RequestBody @Valid DeleteResourcesRequest deleteItemsRequest) { return navigatorService.deleteResources(deleteItemsRequest.getResources()); } 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; }