@Test public void delete() throws IOException { controller.delete(2L, 3L); verify(sharedToUserRepository).delete(Matchers.<SharedToUserPK>any()); }
@RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.DELETE) @ResponseBody @ResponseStatus(HttpStatus.NO_CONTENT) public void delete( @PathVariable("searchId") final long searchId, @PathVariable("userId") final long userId ) { sharedToUserRepository.delete(new SharedToUserPK(searchId, userId)); }
SharedToUserController { @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.DELETE) @ResponseBody @ResponseStatus(HttpStatus.NO_CONTENT) public void delete( @PathVariable("searchId") final long searchId, @PathVariable("userId") final long userId ) { sharedToUserRepository.delete(new SharedToUserPK(searchId, userId)); } }
SharedToUserController { @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.DELETE) @ResponseBody @ResponseStatus(HttpStatus.NO_CONTENT) public void delete( @PathVariable("searchId") final long searchId, @PathVariable("userId") final long userId ) { sharedToUserRepository.delete(new SharedToUserPK(searchId, userId)); } @Autowired  SharedToUserController(
            final SharedToUserService sharedToUserService,
            final SharedToUserRepository sharedToUserRepository,
            final UserEntityService userEntityService
    ); }
SharedToUserController { @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.DELETE) @ResponseBody @ResponseStatus(HttpStatus.NO_CONTENT) public void delete( @PathVariable("searchId") final long searchId, @PathVariable("userId") final long userId ) { sharedToUserRepository.delete(new SharedToUserPK(searchId, userId)); } @Autowired  SharedToUserController(
            final SharedToUserService sharedToUserService,
            final SharedToUserRepository sharedToUserRepository,
            final UserEntityService userEntityService
    ); @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}", method = RequestMethod.GET) @ResponseBody Set<SharedToUser> getPermissionsForSearch(
            @PathVariable(SEARCH_ID_PARAM) final Long searchId,
            @RequestParam(value = USERNAME_PARAM, required = false) final String username
    ); @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}", method = {RequestMethod.PUT, RequestMethod.POST}) @ResponseBody SharedToUser save(
            @RequestBody final SharedToUser sharedToUser,
            @PathVariable("searchId") final long searchId
    ); @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.PUT) @ResponseBody SharedToUser save(
            @RequestBody final SharedToUser sharedToUser,
            @PathVariable("searchId") final long searchId,
            @PathVariable("userId") final long userId
    ); @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.DELETE) @ResponseBody @ResponseStatus(HttpStatus.NO_CONTENT) void delete(
            @PathVariable("searchId") final long searchId,
            @PathVariable("userId") final long userId
    ); }
SharedToUserController { @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.DELETE) @ResponseBody @ResponseStatus(HttpStatus.NO_CONTENT) public void delete( @PathVariable("searchId") final long searchId, @PathVariable("userId") final long userId ) { sharedToUserRepository.delete(new SharedToUserPK(searchId, userId)); } @Autowired  SharedToUserController(
            final SharedToUserService sharedToUserService,
            final SharedToUserRepository sharedToUserRepository,
            final UserEntityService userEntityService
    ); @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}", method = RequestMethod.GET) @ResponseBody Set<SharedToUser> getPermissionsForSearch(
            @PathVariable(SEARCH_ID_PARAM) final Long searchId,
            @RequestParam(value = USERNAME_PARAM, required = false) final String username
    ); @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}", method = {RequestMethod.PUT, RequestMethod.POST}) @ResponseBody SharedToUser save(
            @RequestBody final SharedToUser sharedToUser,
            @PathVariable("searchId") final long searchId
    ); @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.PUT) @ResponseBody SharedToUser save(
            @RequestBody final SharedToUser sharedToUser,
            @PathVariable("searchId") final long searchId,
            @PathVariable("userId") final long userId
    ); @RequestMapping(value = PERMISSIONS_PATH + "/{searchId}/{userId}", method = RequestMethod.DELETE) @ResponseBody @ResponseStatus(HttpStatus.NO_CONTENT) void delete(
            @PathVariable("searchId") final long searchId,
            @PathVariable("userId") final long userId
    );  }