Package org.opentripplanner.api.model.alertpatch

Examples of org.opentripplanner.api.model.alertpatch.AlertPatchResponse


    @Path("/stopPatches")
    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML + Q, MediaType.TEXT_XML + Q })
    public AlertPatchResponse getStopPatches(@QueryParam("agency") String agency,
            @QueryParam("id") String id) {

        AlertPatchResponse response = new AlertPatchResponse();
        Collection<AlertPatch> alertPatches = alertPatchService.getStopPatches(new AgencyAndId(agency, id));
        for (AlertPatch alertPatch : alertPatches) {
            response.addAlertPatch(alertPatch);
        }
        return response;
    }
View Full Code Here


    @Path("/routePatches")
    @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML + Q, MediaType.TEXT_XML + Q })
    public AlertPatchResponse getRoutePatches(@QueryParam("agency") String agency,
            @QueryParam("id") String id) {

        AlertPatchResponse response = new AlertPatchResponse();
        Collection<AlertPatch> alertPatches =
                alertPatchService.getRoutePatches(new AgencyAndId(agency, id));
        for (AlertPatch alertPatch : alertPatches) {
            response.addAlertPatch(alertPatch);
        }
        return response;
    }
View Full Code Here

        AlertPatchService service = mock(AlertPatchService.class);
        when(service.getStopPatches(any(AgencyAndId.class))).thenReturn(new ArrayList<AlertPatch>());
        when(service.getRoutePatches(any(AgencyAndId.class))).thenReturn(new ArrayList<AlertPatch>());

        p.alertPatchService = service;
        AlertPatchResponse stopPatches = p.getStopPatches("TriMet", "5678");
        assertNull(stopPatches.alertPatches);
        AlertPatchResponse routePatches = p.getRoutePatches("TriMet", "100");
        assertNull(routePatches.alertPatches);
    }
View Full Code Here

TOP

Related Classes of org.opentripplanner.api.model.alertpatch.AlertPatchResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.