From 271f30587eec18e75e0a428b615c30b7a6bc7924 Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Thu, 19 Dec 2024 11:15:38 +0000 Subject: [PATCH] move Herrenberg data into the test method --- .../OsmBoardingLocationsModuleTest.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java index 18c40bac898..e0cf32eda9b 100644 --- a/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java +++ b/application/src/test/java/org/opentripplanner/graph_builder/module/OsmBoardingLocationsModuleTest.java @@ -42,16 +42,6 @@ class OsmBoardingLocationsModuleTest { private final TimetableRepositoryForTest testModel = TimetableRepositoryForTest.of(); - File file = ResourceLoader - .of(OsmBoardingLocationsModuleTest.class) - .file("herrenberg-minimal.osm.pbf"); - RegularStop platform = testModel - .stop("de:08115:4512:4:101") - .withCoordinate(48.59328, 8.86128) - .build(); - RegularStop busStop = testModel.stop("de:08115:4512:5:C", 48.59434, 8.86452).build(); - RegularStop floatingBusStop = testModel.stop("floating-bus-stop", 48.59417, 8.86464).build(); - static Stream testCases() { return Stream.of( Arguments.of( @@ -70,6 +60,16 @@ static Stream testCases() { ) @MethodSource("testCases") void addAndLinkBoardingLocations(boolean areaVisibility, Set linkedVertices) { + File file = ResourceLoader + .of(OsmBoardingLocationsModuleTest.class) + .file("herrenberg-minimal.osm.pbf"); + RegularStop platform = testModel + .stop("de:08115:4512:4:101") + .withCoordinate(48.59328, 8.86128) + .build(); + RegularStop busStop = testModel.stop("de:08115:4512:5:C", 48.59434, 8.86452).build(); + RegularStop floatingBusStop = testModel.stop("floating-bus-stop", 48.59417, 8.86464).build(); + var deduplicator = new Deduplicator(); var graph = new Graph(deduplicator); var timetableRepository = new TimetableRepository(new SiteRepository(), deduplicator); @@ -146,13 +146,13 @@ void addAndLinkBoardingLocations(boolean areaVisibility, Set linkedVerti assertEquals(1, platformCentroids.size()); - var platform = platformCentroids.get(0); + var platformCentroid = platformCentroids.get(0); - assertConnections(platform, Set.of(BoardingLocationToStopLink.class, AreaEdge.class)); + assertConnections(platformCentroid, Set.of(BoardingLocationToStopLink.class, AreaEdge.class)); assertEquals( linkedVertices, - platform + platformCentroid .getOutgoingStreetEdges() .stream() .map(Edge::getToVertex) @@ -162,7 +162,7 @@ void addAndLinkBoardingLocations(boolean areaVisibility, Set linkedVerti assertEquals( linkedVertices, - platform + platformCentroid .getIncomingStreetEdges() .stream() .map(Edge::getFromVertex)