VertexResource extends AbstractSubResource { @POST @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.vertices.object.post", absolute = true) public Response postNullVertexOnUri(@Context final Request request, @PathParam("graphname") final String graphName) { final Variant v = request.selectVariant(producesVariantList); return this.postVertex(graphName, null, true, v); } VertexResource();  VertexResource(final UriInfo ui, final HttpServletRequest req, final RexsterApplication ra); @OPTIONS Response optionsVertices(); @GET @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON}) @Timed(name = "http.rest.vertices.collection.get", absolute = true) Response getVertices(@PathParam("graphname") final String graphName); @GET @Produces({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.vertices.collection.get", absolute = true) Response getVerticesRexsterJson(@PathParam("graphname") final String graphName); @OPTIONS @Path("/{id}") Response optionsSingleVertex(); @GET @Path("/{id}") @Produces({MediaType.APPLICATION_JSON}) @Timed(name = "http.rest.vertices.object.get", absolute = true) Response getSingleVertex(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @GET @Path("/{id}") @Produces({RexsterMediaType.APPLICATION_REXSTER_JSON}) @Timed(name = "http.rest.vertices.object.get", absolute = true) Response getSingleVertexRexsterJson(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @GET @Path("/{id}") @Produces({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.vertices.object.get", absolute = true) Response getSingleVertexRexsterTypedJson(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @HEAD @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Consumes(MediaType.APPLICATION_JSON) Response headVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @HEAD @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") Response headVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @PUT @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Consumes(MediaType.APPLICATION_JSON) @Timed(name = "http.rest.vertices.extension.put", absolute = true) Response putVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @PUT @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Timed(name = "http.rest.vertices.extension.put", absolute = true) Response putVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final MultivaluedMap<String, String> formParams); @PUT @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Timed(name = "http.rest.vertices.extension.put", absolute = true) Response putVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @OPTIONS @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Consumes(MediaType.APPLICATION_JSON) Response optionsVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @OPTIONS @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") Response optionsVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @DELETE @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Consumes(MediaType.APPLICATION_JSON) @Timed(name = "http.rest.vertices.extension.delete", absolute = true) Response deleteVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @DELETE @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Timed(name = "http.rest.vertices.extension.delete", absolute = true) Response deleteVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @POST @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Consumes(MediaType.APPLICATION_JSON) @Timed(name = "http.rest.vertices.extension.post", absolute = true) Response postVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final JSONObject json); @POST @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Timed(name = "http.rest.vertices.extension.post", absolute = true) Response postVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id, final MultivaluedMap<String, String> formParams); @POST @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Timed(name = "http.rest.vertices.extension.post", absolute = true) Response postVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @GET @Path("/{id}/{extension: (?!outE)(?!bothE)(?!inE)(?!out)(?!both)(?!in)(?!query).+}") @Timed(name = "http.rest.vertices.extension.get", absolute = true) Response getVertexExtension(@PathParam("graphname") final String graphName, @PathParam("id") final String id); @OPTIONS @Path("/{id}/{direction}") Response optionsVertexEdges(); @GET @Path("/{id}/{direction}") @Produces({MediaType.APPLICATION_JSON, RexsterMediaType.APPLICATION_REXSTER_JSON}) @Timed(name = "http.rest.vertices.object.edges.collection.get", absolute = true) Response getVertexEdges(@PathParam("graphname") String graphName, @PathParam("id") String vertexId, @PathParam("direction") String direction); @GET @Path("/{id}/{direction}") @Produces({RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON}) @Timed(name = "http.rest.vertices.object.edges.collection.get", absolute = true) Response getVertexEdgesRexsterTypedJson(@PathParam("graphname") String graphName, @PathParam("id") String vertexId, @PathParam("direction") String direction); @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.vertices.object.post", absolute = true) Response postNullVertexRexsterConsumesJson(@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.vertices.object.post", absolute = true) Response postNullVertexRexsterConsumesTypedJson(@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.vertices.object.post", absolute = true) Response postNullVertexOnUri(@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.vertices.object.post", absolute = true) Response postVertexConsumesJson(@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.vertices.object.post", absolute = true) Response postVertexRexsterConsumesTypedJson(@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.vertices.object.post", absolute = true) Response postVertexOnUri(@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.vertices.object.put", absolute = true) Response putVertexConsumesJson(@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.vertices.object.put", absolute = true) Response putVertexConsumesTypedJson(@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.vertices.object.put", absolute = true) Response putVertexConsumesUri(@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.vertices.object.delete", absolute = true) Response deleteVertex(@PathParam("graphname") String graphName, @PathParam("id") String id);  }
@Test public void postNullVertexOnUriAcceptTypedJsonValid() { final HashMap<String, Object> parameters = generateVertexParametersToPost(true); final ResourceHolder<VertexResource> holder = constructVertexResource(false, parameters, RexsterMediaType.APPLICATION_REXSTER_TYPED_JSON_TYPE); final VertexResource resource = holder.getResource(); final Response response = resource.postNullVertexOnUri(holder.getRequest(), graphName); assertPostVertexProducesJson(response, false, true); }