StaticAnnouncementResource { @DELETE @Path("{id}") public void delete(@PathParam("id") Id<Service> id) { store.delete(id); } @Inject  StaticAnnouncementResource(StaticStore store, NodeInfo nodeInfo); @POST @Consumes("application/json") @Produces("application/json") Response post(StaticAnnouncement announcement, @Context UriInfo uriInfo); @GET @Produces("application/json") Services get(); @DELETE @Path("{id}") void delete(@PathParam("id") Id<Service> id);  }
@Test public void testDelete() { Service blue = new Service(Id.<Service>random(), null, "storage", "alpha", "/a/b/c", ImmutableMap.of("key", "valueBlue")); Service red = new Service(Id.<Service>random(), null, "storage", "alpha", "/a/b/c", ImmutableMap.of("key", "valueRed")); store.put(red); store.put(blue); resource.delete(blue.getId()); assertEquals(store.getAll(), ImmutableSet.of(red)); }