From 3bc00aa804034eccfd34ed7ac800a3d1aa2a3c32 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Tue, 31 Oct 2023 13:20:45 +0100 Subject: [PATCH] Add agency to route --- src/main/java/org/opentripplanner/client/model/Route.java | 3 ++- src/test/java/org/opentripplanner/IntegrationTest.java | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opentripplanner/client/model/Route.java b/src/main/java/org/opentripplanner/client/model/Route.java index 143fd8b..7ae7d60 100644 --- a/src/main/java/org/opentripplanner/client/model/Route.java +++ b/src/main/java/org/opentripplanner/client/model/Route.java @@ -2,7 +2,8 @@ import java.util.Optional; -public record Route(Optional shortName, Optional longName, TransitMode mode) { +public record Route( + Optional shortName, Optional longName, TransitMode mode, Agency agency) { /** * Either the short name (if it has one) or the long name. diff --git a/src/test/java/org/opentripplanner/IntegrationTest.java b/src/test/java/org/opentripplanner/IntegrationTest.java index 53872e4..16c43db 100644 --- a/src/test/java/org/opentripplanner/IntegrationTest.java +++ b/src/test/java/org/opentripplanner/IntegrationTest.java @@ -101,7 +101,11 @@ public void routes() throws IOException { LOG.info("Received {} routes", routes.size()); assertFalse(routes.isEmpty()); - routes.forEach(r -> assertFalse(r.name().isEmpty(), "Route %s has no name.".formatted(r))); + routes.forEach( + r -> { + assertFalse(r.name().isEmpty(), "Route %s has no name.".formatted(r)); + assertFalse(r.agency().name().isEmpty()); + }); } @Test