Skip to content

Commit

Permalink
Add actual test
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Feb 15, 2024
1 parent 9dab4fb commit a7bebee
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/test/java/org/opentripplanner/smoketest/SeattleSmokeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.opentripplanner.client.model.LegMode;
import org.opentripplanner.client.model.Route;
import org.opentripplanner.client.model.TripPlan;
import org.opentripplanner.client.parameters.TripPlanParameters;
import org.opentripplanner.client.parameters.TripPlanParametersBuilder;
import org.opentripplanner.smoketest.util.SmokeTestRequest;

Expand Down Expand Up @@ -99,8 +100,8 @@ public void ccswwIntoKingCounty() {
new SmokeTestRequest(esperance, shoreline, modes),
List.of("BUS")
);
var itin = plan.itineraries().get(0);
var flexLeg = itin.transitLegs().get(0);
var itin = plan.itineraries().getFirst();
var flexLeg = itin.transitLegs().getFirst();
assertEquals(CCSWW_ROUTE, flexLeg.route().name());
assertEquals(CCSWW_ROUTE, flexLeg.route().agency().name());
}
Expand Down Expand Up @@ -136,6 +137,25 @@ public void monorailRoute() throws IOException {
assertEquals(Set.of("MONORAIL", "TRAM", "FERRY", "BUS", "RAIL"), modes);
}

@Test
public void sharedStop() throws IOException {
Coordinate OLIVE_WAY = new Coordinate(47.61309420, -122.336314916);
Coordinate MOUNTAINLAKE_TERRACE = new Coordinate(47.78682093, -122.315694093);
var tpr = TripPlanParameters
.builder()
.withFrom(OLIVE_WAY)
.withTo(MOUNTAINLAKE_TERRACE)
.withModes(BUS, WALK)
.withTime(SmokeTest.weekdayAtNoon().withHour(14).withMinute(30))
.build();
var plan = SmokeTest.API_CLIENT.plan(tpr);
var itineraries = plan.itineraries();

var first = itineraries.getFirst();
var leg = first.transitLegs().getFirst();
assertEquals("510", leg.route().shortName().get());
}

@Test
public void vehiclePositions() {
SmokeTest.assertThereArePatternsWithVehiclePositions();
Expand Down

0 comments on commit a7bebee

Please sign in to comment.