Skip to content

Commit af435f8

Browse files
Make test more robust
1 parent 4c03cf5 commit af435f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/test/java/org/opentripplanner/IntegrationTest.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ public void plan() throws IOException {
6464

6565
var leg = result.itineraries().get(0).legs().get(0);
6666

67-
var transitLeg = result.transitItineraries().get(0).transitLegs().get(0);
67+
var transitLeg =
68+
result.transitItineraries().stream()
69+
.filter(i -> i.legs().stream().anyMatch(l -> !l.intermediatePlaces().isEmpty()))
70+
.findFirst()
71+
.get()
72+
.transitLegs()
73+
.get(0);
6874
assertFalse(transitLeg.from().stop().isEmpty());
6975
assertNotNull(transitLeg.from().coordinate());
7076
assertNotNull(transitLeg.from().point());

0 commit comments

Comments
 (0)