### Question:
CassandraInstanceResource { @DELETE @Path("{id}") public Response deleteInstance(@PathParam("id") int id) { service.delete(ring.getName(), getByIdIfFound(id)); return Response.noContent().build(); } @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);  }### Answer:
@Test public void deleteInstance() throws Exception { CassandraInstance instance = createMock(CassandraInstance.class); expect(service.findById(RING_NAME, CASSANDRA_ID)).andReturn(instance); service.delete(RING_NAME, instance); replayAll(); Response response = resource.deleteInstance(CASSANDRA_ID); assertEquals(Status.NO_CONTENT.getStatusCode(), response.getStatus()); }