StaticAnnouncementResource { @GET @Produces("application/json") public Services get() { return new Services(nodeInfo.getEnvironment(), store.getAll()); } @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 testGet() { 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); Services actual = resource.get(); Services expected = new Services("testing", ImmutableSet.of(red, blue)); assertEquals(actual, expected); }