diff --git a/src/main/java/org/opentripplanner/client/model/RequestMode.java b/src/main/java/org/opentripplanner/client/model/RequestMode.java index 0afa9c9..12b85a5 100644 --- a/src/main/java/org/opentripplanner/client/model/RequestMode.java +++ b/src/main/java/org/opentripplanner/client/model/RequestMode.java @@ -8,8 +8,11 @@ public enum RequestMode { SUBWAY("SUBWAY"), TRAM("TRAM"), FERRY("FERRY"), + CAR("CAR"), + CAR_PARK("CAR", "PARK"), SCOOTER_RENT("SCOOTER", "RENT"), BICYCLE("BICYCLE"), + BICYCLE_PARK("BICYCLE", "PARK"), BICYCLE_RENT("BICYCLE", "RENT"), FLEX_DIRECT("FLEX", "DIRECT"), FLEX_ACCESS("FLEX", "ACCESS"), diff --git a/src/test/java/org/opentripplanner/IntegrationTest.java b/src/test/java/org/opentripplanner/IntegrationTest.java index 7b8f1ea..deb98d7 100644 --- a/src/test/java/org/opentripplanner/IntegrationTest.java +++ b/src/test/java/org/opentripplanner/IntegrationTest.java @@ -253,6 +253,57 @@ public void bikePlan() throws IOException { assertNotNull(result.itineraries().get(0).legs().get(0).startTime()); } + @Test + public void bikeAndParkPlan() throws IOException { + + var result = + client.plan( + TripPlanParameters.builder() + .withFrom(OSLO_WEST) + .withTo(OSLO_EAST) + .withTime(LocalDateTime.now()) + .withModes(Set.of(RequestMode.BICYCLE_PARK, RequestMode.TRANSIT)) + .build()); + + LOG.info("Received {} itineraries", result.itineraries().size()); + + assertNotNull(result.itineraries().get(0).legs().get(0).startTime()); + } + + @Test + public void carPlan() throws IOException { + + var result = + client.plan( + TripPlanParameters.builder() + .withFrom(OSLO_WEST) + .withTo(OSLO_EAST) + .withTime(LocalDateTime.now()) + .withModes(Set.of(RequestMode.CAR)) + .build()); + + LOG.info("Received {} itineraries", result.itineraries().size()); + + assertNotNull(result.itineraries().get(0).legs().get(0).startTime()); + } + + @Test + public void carAndParkPlan() throws IOException { + + var result = + client.plan( + TripPlanParameters.builder() + .withFrom(OSLO_WEST) + .withTo(OSLO_EAST) + .withTime(LocalDateTime.now()) + .withModes(Set.of(RequestMode.CAR_PARK, RequestMode.TRANSIT)) + .build()); + + LOG.info("Received {} itineraries", result.itineraries().size()); + + assertNotNull(result.itineraries().get(0).legs().get(0).startTime()); + } + @Test public void rentalStations() throws IOException {