@Test public void postInvalidOVFTest() { ApplicationRest applicationRest = new ApplicationRest(); Response response = applicationRest.postApplication("automatic", null, "XXX"); assertEquals(400, response.getStatus()); String message = (String) response.getEntity(); assertEquals("Invalid OVF", message); }
@POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response postApplication(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload) { logger.info("POST request to path: /applications?negotiation=" + negotiation); logger.info(" PAYLOAD: " + payload); return createNewDeployment(payload, negotiation, schema, true); }
ApplicationRest extends AbstractRest { @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response postApplication(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload) { logger.info("POST request to path: /applications?negotiation=" + negotiation); logger.info(" PAYLOAD: " + payload); return createNewDeployment(payload, negotiation, schema, true); } }
ApplicationRest extends AbstractRest { @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response postApplication(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload) { logger.info("POST request to path: /applications?negotiation=" + negotiation); logger.info(" PAYLOAD: " + payload); return createNewDeployment(payload, negotiation, schema, true); }  }
ApplicationRest extends AbstractRest { @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response postApplication(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload) { logger.info("POST request to path: /applications?negotiation=" + negotiation); logger.info(" PAYLOAD: " + payload); return createNewDeployment(payload, negotiation, schema, true); }  @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 { @POST @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public Response postApplication(@QueryParam("negotiation") String negotiation, @QueryParam("schema") String schema, String payload) { logger.info("POST request to path: /applications?negotiation=" + negotiation); logger.info(" PAYLOAD: " + payload); return createNewDeployment(payload, negotiation, schema, true); }  @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);  }