SavedSnapshotController { @RequestMapping(value = "{id}", method = RequestMethod.DELETE) public void delete( @PathVariable("id") final long id ) { service.deleteById(id); } @SuppressWarnings("TypeMayBeWeakened") @Autowired  SavedSnapshotController(final SavedSearchService<SavedSnapshot, Builder> service,
                                   final ConfigService<DashboardConfig> dashboardConfigService); @RequestMapping(method = RequestMethod.GET) Set<SavedSnapshot> getAll(); @RequestMapping(value = GET_SHARED, method = RequestMethod.GET) Set<SavedSnapshot> getShared(); @RequestMapping(method = RequestMethod.POST) SavedSnapshot create(
            @RequestBody final SavedQuery query
    ); @RequestMapping(value = "{id}", method = RequestMethod.PUT) SavedSnapshot update(
            @PathVariable("id") final long id,
            @RequestBody final SavedSnapshot snapshot
    ); @RequestMapping(value = "shared/{id}", method = RequestMethod.PUT) SavedSnapshot updateShared(
            @PathVariable("id") final long id,
            @RequestBody final SavedSnapshot snapshot
    ); @RequestMapping(value = "{id}", method = RequestMethod.DELETE) void delete(
            @PathVariable("id") final long id
    ); @RequestMapping(method = RequestMethod.GET, value = "/{id}") SavedSnapshot get(@PathVariable("id") final long id);  }
@Test public void delete() { savedSnapshotController.delete(42L); verify(savedSnapshotService).deleteById(eq(42L)); }