@Test public void getProtocolVersion() throws Exception { VersionResource resource = new VersionResource(); Response result = resource.getProtocolVersion(); assertEquals(Response.Status.OK, Response.Status.fromStatusCode(result.getStatus())); assertEquals( "{ \"version\": \"" + Version.PXF_PROTOCOL_VERSION + "\"}", result.getEntity().toString()); assertEquals(result.getMetadata().get(HttpHeaders.CONTENT_TYPE).get(0), MediaType.APPLICATION_JSON_TYPE); }
@GET @Produces("application/json") public Response getProtocolVersion() { ResponseBuilder b = Response.ok(); b.entity("{ \"version\": \"" + Version.PXF_PROTOCOL_VERSION + "\"}"); b.type(MediaType.APPLICATION_JSON_TYPE); return b.build(); }
VersionResource { @GET @Produces("application/json") public Response getProtocolVersion() { ResponseBuilder b = Response.ok(); b.entity("{ \"version\": \"" + Version.PXF_PROTOCOL_VERSION + "\"}"); b.type(MediaType.APPLICATION_JSON_TYPE); return b.build(); } }
VersionResource { @GET @Produces("application/json") public Response getProtocolVersion() { ResponseBuilder b = Response.ok(); b.entity("{ \"version\": \"" + Version.PXF_PROTOCOL_VERSION + "\"}"); b.type(MediaType.APPLICATION_JSON_TYPE); return b.build(); } VersionResource(); }
VersionResource { @GET @Produces("application/json") public Response getProtocolVersion() { ResponseBuilder b = Response.ok(); b.entity("{ \"version\": \"" + Version.PXF_PROTOCOL_VERSION + "\"}"); b.type(MediaType.APPLICATION_JSON_TYPE); return b.build(); } VersionResource(); @GET @Produces("application/json") Response getProtocolVersion(); }
VersionResource { @GET @Produces("application/json") public Response getProtocolVersion() { ResponseBuilder b = Response.ok(); b.entity("{ \"version\": \"" + Version.PXF_PROTOCOL_VERSION + "\"}"); b.type(MediaType.APPLICATION_JSON_TYPE); return b.build(); } VersionResource(); @GET @Produces("application/json") Response getProtocolVersion();  }