@Test @InSequence(6) public void testDeleteAll() { Employee[] list = target.request().get(Employee[].class); for (Employee p : list) { target .path("{name}") .resolveTemplate("name", p.getName()) .request() .delete(); } list = target.request().get(Employee[].class); assertEquals(0, list.length); }
@GET @Produces({ "application/json", "application/xml" }) @Path("{id}") public Employee get(@PathParam("id") int id) { if (id < bean.getEmployees().size()) return bean.getEmployees().get(id); else return null; }
EmployeeResource { @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") public Employee get(@PathParam("id") int id) { if (id < bean.getEmployees().size()) return bean.getEmployees().get(id); else return null; } }
EmployeeResource { @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") public Employee get(@PathParam("id") int id) { if (id < bean.getEmployees().size()) return bean.getEmployees().get(id); else return null; }  }
EmployeeResource { @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") public Employee get(@PathParam("id") int id) { if (id < bean.getEmployees().size()) return bean.getEmployees().get(id); else return null; }  @GET @Produces({ "application/xml", "application/json" }) Employee[] getList(); @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") Employee get(@PathParam("id") int id); @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) void addToList(@FormParam("name") String name,
         @FormParam("age") int age); @PUT void putToList(@FormParam("name") String name,
         @FormParam("age") int age); @DELETE @Path("{name}") void deleteFromList(@PathParam("name") String name); }
EmployeeResource { @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") public Employee get(@PathParam("id") int id) { if (id < bean.getEmployees().size()) return bean.getEmployees().get(id); else return null; }  @GET @Produces({ "application/xml", "application/json" }) Employee[] getList(); @GET @Produces({ "application/json", "application/xml" }) @Path("{id}") Employee get(@PathParam("id") int id); @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) void addToList(@FormParam("name") String name,
         @FormParam("age") int age); @PUT void putToList(@FormParam("name") String name,
         @FormParam("age") int age); @DELETE @Path("{name}") void deleteFromList(@PathParam("name") String name);  }