WebService { @GET @Path("/ping") @Produces(MediaType.APPLICATION_JSON) public String ping() { return "\"pong\""; }  @POST @Path("/request") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) WebResponse process(WebRequest req); @GET @Path("/agents") @Produces(MediaType.APPLICATION_JSON) Description[] getAgents(); @GET @Path("/ping") @Produces(MediaType.APPLICATION_JSON) String ping();  }
@Test public void testPing() { javax.ws.rs.core.Response response = target("/ping").request(MediaType.APPLICATION_JSON_TYPE).get(); assertEquals(200, response.getStatus()); String expected = "\"pong\""; assertEquals(expected, response.readEntity(String.class)); }