@Test public void findAll() throws Exception { CassandraInstance instance1 = createMock(CassandraInstance.class); CassandraInstance instance2 = createMock(CassandraInstance.class); ImmutableSet<CassandraInstance> instances = ImmutableSet.of(instance1, instance2); expect(service.findAll(RING_NAME)).andReturn(instances); replayAll(); assertEquals(instances, resource.findAll()); }
@GET public Set<CassandraInstance> findAll() { return service.findAll(ring.getName()); }
CassandraInstanceResource { @GET public Set<CassandraInstance> findAll() { return service.findAll(ring.getName()); } }
CassandraInstanceResource { @GET public Set<CassandraInstance> findAll() { return service.findAll(ring.getName()); } @Inject  CassandraInstanceResource(CassandraInstanceService service, @Assisted CassandraRing ring); }
CassandraInstanceResource { @GET public Set<CassandraInstance> findAll() { return service.findAll(ring.getName()); } @Inject  CassandraInstanceResource(CassandraInstanceService service, @Assisted CassandraRing ring); @GET Set<CassandraInstance> findAll(); @POST Response createInstance(@Valid CassandraInstance instance); @GET @Path("{id}") CassandraInstance findById(@PathParam("id") int id); @DELETE @Path("{id}") Response deleteInstance(@PathParam("id") int id); }
CassandraInstanceResource { @GET public Set<CassandraInstance> findAll() { return service.findAll(ring.getName()); } @Inject  CassandraInstanceResource(CassandraInstanceService service, @Assisted CassandraRing ring); @GET Set<CassandraInstance> findAll(); @POST Response createInstance(@Valid CassandraInstance instance); @GET @Path("{id}") CassandraInstance findById(@PathParam("id") int id); @DELETE @Path("{id}") Response deleteInstance(@PathParam("id") int id);  }