@Test public void getApplicationsJSONTest() { ApplicationRest applicationRest = prepareApplicationRestForGetApplicationsTest(); Response response = applicationRest.getApplicationsJSON(); assertEquals(200, response.getStatus()); String json = (String) response.getEntity(); Collection collection = ModelConverter.jsonCollectionToObject(json); evaluateResutlsOfGetCollectionsOfApplications(collection); }
@GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationsJSON() { logger.info("GET request to path: /applications in JSON format"); List<Application> applications = getApplicationsFromDB(); String json = XMLBuilder.getCollectionApplicationsJSON(applications); return buildResponse(Status.OK, json); }
ApplicationRest extends AbstractRest { @GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationsJSON() { logger.info("GET request to path: /applications in JSON format"); List<Application> applications = getApplicationsFromDB(); String json = XMLBuilder.getCollectionApplicationsJSON(applications); return buildResponse(Status.OK, json); } }
ApplicationRest extends AbstractRest { @GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationsJSON() { logger.info("GET request to path: /applications in JSON format"); List<Application> applications = getApplicationsFromDB(); String json = XMLBuilder.getCollectionApplicationsJSON(applications); return buildResponse(Status.OK, json); }  }
ApplicationRest extends AbstractRest { @GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationsJSON() { logger.info("GET request to path: /applications in JSON format"); List<Application> applications = getApplicationsFromDB(); String json = XMLBuilder.getCollectionApplicationsJSON(applications); return buildResponse(Status.OK, json); }  @GET @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getApplications(); @GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getApplicationsJSON(); @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) Response postApplication(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload); @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_JSON) Response postApplicationJSON(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload); @GET @Path("{application_name}") @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getApplication(@PathParam("application_name") String applicationName); @GET @Path("{application_name}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getApplicationJSON(@PathParam("application_name") String applicationName); @DELETE @Path("{application_name}") Response deleteApplication(@PathParam("application_name") String applicationName); }
ApplicationRest extends AbstractRest { @GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationsJSON() { logger.info("GET request to path: /applications in JSON format"); List<Application> applications = getApplicationsFromDB(); String json = XMLBuilder.getCollectionApplicationsJSON(applications); return buildResponse(Status.OK, json); }  @GET @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getApplications(); @GET @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getApplicationsJSON(); @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) Response postApplication(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload); @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_JSON) Response postApplicationJSON(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload); @GET @Path("{application_name}") @Produces(MediaType.APPLICATION_XML + ";qs=1") Response getApplication(@PathParam("application_name") String applicationName); @GET @Path("{application_name}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") Response getApplicationJSON(@PathParam("application_name") String applicationName); @DELETE @Path("{application_name}") Response deleteApplication(@PathParam("application_name") String applicationName);  }