RestRules { @GET @Produces(MediaType.APPLICATION_JSON) public Response list() { RestListener listener = RestManager.getListener(); Response response; try { List<Map<String, Object>> list = listener.list(); log.info("List request {}", list); response = Response.ok().entity(list).build(); } catch (Exception e) { e.printStackTrace(); response = Response.serverError() .entity(toMap(e, Response.Status.INTERNAL_SERVER_ERROR)) .build(); } return response; }  @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response add(String json); @DELETE @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) Response remove(@PathParam("id") String id); @POST @Path("/synchronize") @Consumes (MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response synchronize(String json); @GET @Produces(MediaType.APPLICATION_JSON) Response list();  }
@Test public void list() throws Exception { Response response = target("/v1/").request(MediaType.APPLICATION_JSON_TYPE).get(); int statusCode = response.getStatus(); assertEquals(Response.Status.OK.getStatusCode(), statusCode); }