ResourceSpeaker { @DELETE @Path("/remove/{id}") public void remove(@PathParam("id") final String id) { this.speakerDAO.remove(id); }  @GET Collection<Speaker> retrieveAll(); @GET @Path("/nessProbe") @Produces(MediaType.TEXT_PLAIN) Response nessProbe(); @POST @Path("/add") Speaker add(final Speaker speaker); @DELETE @Path("/remove/{id}") void remove(@PathParam("id") final String id); @PUT @Path("/update") Speaker update(final Speaker speaker); @GET @Path("/retrieve/{id}") Speaker retrieve(@PathParam("id") final String id); @PUT @Path("/search") Set<Speaker> search(final Speaker speaker);  }
@Test @RunAsClient public void testRemove() { final Speaker search = new Speaker(); search.setNameFirst("Markus"); search.setNameLast("Eisele"); final Set<Speaker> speakers = this.getWebTarget("speaker/search").request(MediaType.APPLICATION_JSON_TYPE) .put(Entity.json(search)) .readEntity(new GenericType<Set<Speaker>>() { }); final Speaker found = speakers.iterator().next(); final String id = found.getId(); this.getWebTarget("speaker/remove/{id}").resolveTemplate("id", id) .request(MediaType.APPLICATION_JSON_TYPE) .delete(); final Speaker updated = this.getWebTarget("speaker/retrieve/{id}").resolveTemplate("id", id) .request(MediaType.APPLICATION_JSON_TYPE) .get() .readEntity(Speaker.class); Assert.assertNull("Found unexpected response", updated.getId()); }