ManualMapsRoute implements AltoNorthboundRoute { @Path("{path:.+}") @PUT @Produces({ ALTO_CONFIG, ALTO_ERROR }) public Response newResourceRoute (@Context HttpServletRequest request, @PathParam("path") String path, String map) { return Response.ok(CONFIG_SUCCESS + "(PUT: " + path + ")", ALTO_CONFIG).build(); } ManualMapsRoute(AltoManualMapsProvider provider); @Path("{path:.+}") @POST @Produces({ ALTO_CONFIG, ALTO_ERROR }) Response modifyResourceRoute(@Context HttpServletRequest request, @PathParam("path") String path, String map); @Path("{path:.+}") @PUT @Produces({ ALTO_CONFIG, ALTO_ERROR }) Response newResourceRoute(@Context HttpServletRequest request, @PathParam("path") String path, String map); @Path("{path:.+}") @DELETE @Produces({ ALTO_CONFIG, ALTO_ERROR }) Response removeResourceRoute(@Context HttpServletRequest request, @PathParam("path") String path, String map); static final String ALTO_CONFIG; static final String CONFIG_SUCCESS; }
@Test public void newResourceRoute() throws Exception { Response resultResponse = mmr.newResourceRoute(mockRequest, "secondpath", "secondmap"); Response expectResponse = Response.ok(CONFIG_SUCCESS + "(PUT: " + "secondpath" + ")", ALTO_CONFIG).build(); assertEquals(expectResponse.getStatus(), resultResponse.getStatus()); assertEquals(expectResponse.getEntity(), resultResponse.getEntity()); assertEquals(expectResponse.getMetadata(), resultResponse.getMetadata()); }