@Test public void getApplicationJSONTest() { ApplicationRest applicationRest = getApplicationRestForGetApplicationTests(); Response response = applicationRest.getApplicationJSON("1"); assertEquals(200, response.getStatus()); String json = (String) response.getEntity(); Application applicationResponse = ModelConverter.jsonApplicationToObject(json); verifyGetApplicationTests(applicationResponse); }
@GET @Path("{application_name}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationJSON(@PathParam("application_name") String applicationName) { logger.info("GET request to path: /applications/" + applicationName + " in JSON format"); Application application = applicationDAO.getByNameWithoutDeployments(applicationName); String json = XMLBuilder.getApplicationJSON(application); return buildResponse(Status.OK, json); }
ApplicationRest extends AbstractRest { @GET @Path("{application_name}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationJSON(@PathParam("application_name") String applicationName) { logger.info("GET request to path: /applications/" + applicationName + " in JSON format"); Application application = applicationDAO.getByNameWithoutDeployments(applicationName); String json = XMLBuilder.getApplicationJSON(application); return buildResponse(Status.OK, json); } }
ApplicationRest extends AbstractRest { @GET @Path("{application_name}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationJSON(@PathParam("application_name") String applicationName) { logger.info("GET request to path: /applications/" + applicationName + " in JSON format"); Application application = applicationDAO.getByNameWithoutDeployments(applicationName); String json = XMLBuilder.getApplicationJSON(application); return buildResponse(Status.OK, json); }  }
ApplicationRest extends AbstractRest { @GET @Path("{application_name}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationJSON(@PathParam("application_name") String applicationName) { logger.info("GET request to path: /applications/" + applicationName + " in JSON format"); Application application = applicationDAO.getByNameWithoutDeployments(applicationName); String json = XMLBuilder.getApplicationJSON(application); 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 @Path("{application_name}") @Produces(MediaType.APPLICATION_JSON + ";qs=0.5") public Response getApplicationJSON(@PathParam("application_name") String applicationName) { logger.info("GET request to path: /applications/" + applicationName + " in JSON format"); Application application = applicationDAO.getByNameWithoutDeployments(applicationName); String json = XMLBuilder.getApplicationJSON(application); 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);  }