EdgeResource extends AbstractSubResource { @POST @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Consumes({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.post", absolute = true) public Response postNullEdgeConsumesTypedJson(@Context final Request request, @PathParam("graphname") final String graphName, final JSONObject json) { this.setRequestObject(json); Variant v = request.selectVariant(producesVariantList); return this.postEdge(graphName, null, true, v); } EdgeResource();  EdgeResource(final UriInfo ui, final HttpServletRequest req, final RexsterApplication ra); @OPTIONS Response optionsAllEdges(); @GET @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON}) @Timed(name = "http.rest.edges.collection.get", absolute = true) Response getAllEdges(@PathParam("graphname") final String graphName); @GET @Produces({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.collection.get", absolute = true) Response getAllEdgesRexsterTypedJson(@PathParam("graphname") final String graphName); @OPTIONS @Path("/{id}") Response optionsSingleEdge(); @GET @Path("/{id}") @Produces({MediaType.APPLICATION_JSON}) @Timed(name = "http.rest.edges.object.get", absolute = true) Response getSingleEdge(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @GET @Path("/{id}") @Produces({RexsterMediaType.APPLICATION_REXSTER_JSON}) @Timed(name = "http.rest.edges.object.get", absolute = true) Response getSingleEdgeRexsterJson(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @GET @Path("/{id}") @Produces({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.get", absolute = true) Response getSingleEdgeRexsterTypedJson(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @HEAD @Path("/{id}/{extension: .+}") @Consumes(MediaType.APPLICATION_JSON) Response headEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @HEAD @Path("/{id}/{extension: .+}") Response headEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @PUT @Path("/{id}/{extension: .+}") @Consumes(MediaType.APPLICATION_JSON) @Timed(name = "http.rest.edges.object.put", absolute = true) Response putEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @PUT @Path("/{id}/{extension: .+}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Timed(name = "http.rest.edges.object.put", absolute = true) Response putEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final MultivaluedMap<String, String> formParams); @PUT @Path("/{id}/{extension: .+}") @Timed(name = "http.rest.edges.object.put", absolute = true) Response putEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @OPTIONS @Path("/{id}/{extension: .+}") @Consumes(MediaType.APPLICATION_JSON) Response optionsEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @OPTIONS @Path("/{id}/{extension: .+}") Response optionsEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @DELETE @Path("/{id}/{extension: .+}") @Consumes(MediaType.APPLICATION_JSON) @Timed(name = "http.rest.edges.object.delete", absolute = true) Response deleteEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @DELETE @Path("/{id}/{extension: .+}") @Timed(name = "http.rest.edges.object.delete", absolute = true) Response deleteEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @POST @Path("/{id}/{extension: .+}") @Consumes(MediaType.APPLICATION_JSON) @Timed(name = "http.rest.edges.object.post", absolute = true) Response postEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @POST @Path("/{id}/{extension: .+}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Timed(name = "http.rest.edges.object.post", absolute = true) Response postEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final MultivaluedMap<String, String> formParams); @POST @Path("/{id}/{extension: .+}") @Timed(name = "http.rest.edges.object.post", absolute = true) Response postEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @GET @Path("/{id}/{extension: .+}") @Timed(name = "http.rest.edges.object.get", absolute = true) Response getEdgeExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @POST @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Consumes({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON}) @Timed(name = "http.rest.edges.object.post", absolute = true) Response postNullEdgeConsumesJson(@Context final Request request,
                                             @PathParam("graphname") final String graphName, final JSONObject json); @POST @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Consumes({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.post", absolute = true) Response postNullEdgeConsumesTypedJson(@Context final Request request,
                                                  @PathParam("graphname") final String graphName, final JSONObject json); @POST @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.post", absolute = true) Response postNullEdgeConsumesUri(@Context final Request request, @PathParam("graphname") final String graphName); @POST @Path("/{id}") @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Consumes({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON}) @Timed(name = "http.rest.edges.object.post", absolute = true) Response postEdgeConsumesJson(@Context final Request request,
                                         @PathParam("graphname") final String graphName,
                                         @PathParam("id") final String id, final JSONObject json); @POST @Path("/{id}") @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Consumes({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.post", absolute = true) Response postEdgeConsumesTypedJson(@Context final Request request,
                                              @PathParam("graphname") final String graphName,
                                              @PathParam("id") final String id, final JSONObject json); @POST @Path("/{id}") @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.post", absolute = true) Response postEdgeConsumesUri(@Context final Request request,
                                        @PathParam("graphname") final String graphName,
                                        @PathParam("id") final String id); @PUT @Path("/{id}") @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Consumes({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON}) @Timed(name = "http.rest.edges.object.put", absolute = true) Response putEdgeConsumesJson(@Context Request request, @PathParam("graphname") String graphName, @PathParam("id") String id, JSONObject json); @PUT @Path("/{id}") @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Consumes({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.put", absolute = true) Response putEdgeConsumesTypedJson(@Context Request request, @PathParam("graphname") String graphName, @PathParam("id") String id, JSONObject json); @PUT @Path("/{id}") @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.put", absolute = true) Response putEdgeOnUri(@Context Request request, @PathParam("graphname") String graphName, @PathParam("id") String id); @DELETE @Path("/{id}") @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.edges.object.delete", absolute = true) Response deleteEdge(@PathParam("graphname") String graphName, @PathParam("id") String id);  }
@Test public void postNullEdgeConsumesTypedJsonAcceptJsonValid() { final HashMap<String, Object> parameters = generateEdgeParametersToPost(true); final JSONObject jsonToPost = new JSONObject(parameters); this.emptyGraph.addVertex(1); this.emptyGraph.addVertex(2); final ResourceHolder<EdgeResource> holder = this.constructEdgeResource(false, parameters); final EdgeResource resource = holder.getResource(); final Response response = resource.postNullEdgeConsumesTypedJson(holder.getRequest(), graphName, jsonToPost); assertPostEdgeProducesJson(response, false, false); }