Skip to content

Commit

Permalink
Add agency to route
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Oct 31, 2023
1 parent 9e2035f commit 3bc00aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/opentripplanner/client/model/Route.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import java.util.Optional;

public record Route(Optional<String> shortName, Optional<String> longName, TransitMode mode) {
public record Route(
Optional<String> shortName, Optional<String> longName, TransitMode mode, Agency agency) {

/**
* Either the short name (if it has one) or the long name.
Expand Down
6 changes: 5 additions & 1 deletion src/test/java/org/opentripplanner/IntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3bc00aa

Please sign in to comment.