From 7695a1efe9faeabc0b8e1ec6ce6ea35d7d5d9f9f Mon Sep 17 00:00:00 2001 From: Vincent Paturet Date: Mon, 8 Jul 2024 08:04:32 +0200 Subject: [PATCH 1/2] Use transit editor service in SIRI timetable snapshot source --- .../ext/siri/AddedTripBuilderTest.java | 21 +++--- .../ext/siri/AddedTripBuilder.java | 46 ++++++------- .../ext/siri/SiriTimetableSnapshotSource.java | 14 ++-- .../service/DefaultTransitService.java | 69 +++++++++++++++++++ .../transit/service/TransitEditorService.java | 21 ++++++ .../transit/service/TransitModel.java | 2 - .../transit/service/TransitModelIndex.java | 4 -- .../transit/service/TransitService.java | 3 + 8 files changed, 132 insertions(+), 48 deletions(-) diff --git a/src/ext-test/java/org/opentripplanner/ext/siri/AddedTripBuilderTest.java b/src/ext-test/java/org/opentripplanner/ext/siri/AddedTripBuilderTest.java index b7431c16091..911fb015c27 100644 --- a/src/ext-test/java/org/opentripplanner/ext/siri/AddedTripBuilderTest.java +++ b/src/ext-test/java/org/opentripplanner/ext/siri/AddedTripBuilderTest.java @@ -35,6 +35,7 @@ import org.opentripplanner.transit.model.timetable.TripIdAndServiceDate; import org.opentripplanner.transit.service.DefaultTransitService; import org.opentripplanner.transit.service.StopModel; +import org.opentripplanner.transit.service.TransitEditorService; import org.opentripplanner.transit.service.TransitModel; import org.opentripplanner.updater.spi.UpdateError; import uk.org.siri.siri20.VehicleModesEnumeration; @@ -77,6 +78,7 @@ class AddedTripBuilderTest { private final Deduplicator DEDUPLICATOR = new Deduplicator(); private final TransitModel TRANSIT_MODEL = new TransitModel(STOP_MODEL, DEDUPLICATOR); + private TransitEditorService TRANSIT_SERVICE; private EntityResolver ENTITY_RESOLVER; @BeforeEach @@ -101,6 +103,7 @@ void setUp() { // Create transit model index TRANSIT_MODEL.index(); + TRANSIT_SERVICE = new DefaultTransitService(TRANSIT_MODEL); // Create the entity resolver only after the model has been indexed ENTITY_RESOLVER = @@ -110,7 +113,7 @@ void setUp() { @Test void testAddedTrip() { var addedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -239,7 +242,7 @@ void testAddedTrip() { @Test void testAddedTripOnAddedRoute() { var firstAddedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -265,7 +268,7 @@ void testAddedTripOnAddedRoute() { var tripId2 = TransitModelForTest.id("TRIP_ID_2"); var secondAddedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, tripId2, @@ -316,7 +319,7 @@ void testAddedTripOnAddedRoute() { @Test void testAddedTripOnExistingRoute() { var addedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -347,7 +350,7 @@ void testAddedTripOnExistingRoute() { @Test void testAddedTripWithoutReplacedRoute() { var addedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -390,7 +393,7 @@ void testAddedTripWithoutReplacedRoute() { @Test void testAddedTripFailOnMissingServiceId() { var addedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -445,7 +448,7 @@ void testAddedTripFailOnNonIncreasingDwellTime() { ); var addedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -484,7 +487,7 @@ void testAddedTripFailOnTooFewCalls() { .build() ); var addedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -531,7 +534,7 @@ void testAddedTripFailOnUnknownStop() { .build() ); var addedTrip = new AddedTripBuilder( - TRANSIT_MODEL, + TRANSIT_SERVICE, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, diff --git a/src/ext/java/org/opentripplanner/ext/siri/AddedTripBuilder.java b/src/ext/java/org/opentripplanner/ext/siri/AddedTripBuilder.java index aac485da4eb..be5b30b38b9 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/AddedTripBuilder.java +++ b/src/ext/java/org/opentripplanner/ext/siri/AddedTripBuilder.java @@ -36,7 +36,7 @@ import org.opentripplanner.transit.model.timetable.TripIdAndServiceDate; import org.opentripplanner.transit.model.timetable.TripOnServiceDate; import org.opentripplanner.transit.model.timetable.TripTimesFactory; -import org.opentripplanner.transit.service.TransitModel; +import org.opentripplanner.transit.service.TransitEditorService; import org.opentripplanner.updater.spi.DataValidationExceptionMapper; import org.opentripplanner.updater.spi.UpdateError; import org.rutebanken.netex.model.BusSubmodeEnumeration; @@ -52,7 +52,7 @@ class AddedTripBuilder { private static final Logger LOG = LoggerFactory.getLogger(AddedTripBuilder.class); - private final TransitModel transitModel; + private final TransitEditorService transitService; private final EntityResolver entityResolver; private final ZoneId timeZone; private final Function getTripPatternId; @@ -73,7 +73,7 @@ class AddedTripBuilder { AddedTripBuilder( EstimatedVehicleJourney estimatedVehicleJourney, - TransitModel transitModel, + TransitEditorService transitService, EntityResolver entityResolver, Function getTripPatternId ) { @@ -112,16 +112,16 @@ class AddedTripBuilder { calls = CallWrapper.of(estimatedVehicleJourney); - this.transitModel = transitModel; + this.transitService = transitService; this.entityResolver = entityResolver; this.getTripPatternId = getTripPatternId; - timeZone = transitModel.getTimeZone(); + timeZone = transitService.getTimeZone(); replacedTrips = getReplacedVehicleJourneys(estimatedVehicleJourney); } AddedTripBuilder( - TransitModel transitModel, + TransitEditorService transitService, EntityResolver entityResolver, Function getTripPatternId, FeedScopedId tripId, @@ -139,9 +139,9 @@ class AddedTripBuilder { String headsign, List replacedTrips ) { - this.transitModel = transitModel; + this.transitService = transitService; this.entityResolver = entityResolver; - this.timeZone = transitModel.getTimeZone(); + this.timeZone = transitService.getTimeZone(); this.getTripPatternId = getTripPatternId; this.tripId = tripId; this.operator = operator; @@ -168,7 +168,7 @@ Result build() { return UpdateError.result(tripId, NO_START_DATE); } - FeedScopedId calServiceId = transitModel.getOrCreateServiceIdForDate(serviceDate); + FeedScopedId calServiceId = transitService.getOrCreateServiceIdForDate(serviceDate); if (calServiceId == null) { return UpdateError.result(tripId, NO_START_DATE); } @@ -181,7 +181,7 @@ Result build() { } route = createRoute(agency); LOG.info("Adding route {} to transitModel.", route); - transitModel.getTransitModelIndex().addRoutes(route); + transitService.addRoutes(route); } Trip trip = createTrip(route, calServiceId); @@ -221,14 +221,14 @@ Result build() { RealTimeTripTimes tripTimes = TripTimesFactory.tripTimes( trip, aimedStopTimes, - transitModel.getDeduplicator() + transitService.getDeduplicator() ); // validate the scheduled trip times // they are in general superseded by real-time trip times // but in case of trip cancellation, OTP will fall back to scheduled trip times // therefore they must be valid tripTimes.validateNonIncreasingTimes(); - tripTimes.setServiceCode(transitModel.getServiceCodes().get(trip.getServiceId())); + tripTimes.setServiceCode(transitService.getServiceCodeForId(trip.getServiceId())); pattern.add(tripTimes); RealTimeTripTimes updatedTripTimes = tripTimes.copyScheduledTimes(); @@ -267,17 +267,14 @@ Result build() { // Adding trip to index necessary to include values in graphql-queries // TODO - SIRI: should more data be added to index? - transitModel.getTransitModelIndex().getTripForId().put(tripId, trip); - transitModel.getTransitModelIndex().getPatternForTrip().put(trip, pattern); - transitModel.getTransitModelIndex().getPatternsForRoute().put(route, pattern); - transitModel - .getTransitModelIndex() - .getTripOnServiceDateById() - .put(tripOnServiceDate.getId(), tripOnServiceDate); - transitModel - .getTransitModelIndex() - .getTripOnServiceDateForTripAndDay() - .put(new TripIdAndServiceDate(tripId, serviceDate), tripOnServiceDate); + transitService.addTripForId(tripId, trip); + transitService.addPatternForTrip(trip, pattern); + transitService.addPatternsForRoute(route, pattern); + transitService.addTripOnServiceDateById(tripOnServiceDate.getId(), tripOnServiceDate); + transitService.addTripOnServiceDateForTripAndDay( + new TripIdAndServiceDate(tripId, serviceDate), + tripOnServiceDate + ); return Result.success(new TripUpdate(stopPattern, updatedTripTimes, serviceDate)); } @@ -312,8 +309,7 @@ private Route createRoute(Agency agency) { */ @Nullable private Agency resolveAgency() { - return transitModel - .getTransitModelIndex() + return transitService .getAllRoutes() .stream() .filter(r -> r != null && r.getOperator() != null && r.getOperator().equals(operator)) diff --git a/src/ext/java/org/opentripplanner/ext/siri/SiriTimetableSnapshotSource.java b/src/ext/java/org/opentripplanner/ext/siri/SiriTimetableSnapshotSource.java index db9c1fcc441..7ab316bfc55 100644 --- a/src/ext/java/org/opentripplanner/ext/siri/SiriTimetableSnapshotSource.java +++ b/src/ext/java/org/opentripplanner/ext/siri/SiriTimetableSnapshotSource.java @@ -23,8 +23,8 @@ import org.opentripplanner.transit.model.timetable.Trip; import org.opentripplanner.transit.model.timetable.TripTimes; import org.opentripplanner.transit.service.DefaultTransitService; +import org.opentripplanner.transit.service.TransitEditorService; import org.opentripplanner.transit.service.TransitModel; -import org.opentripplanner.transit.service.TransitService; import org.opentripplanner.updater.TimetableSnapshotSourceParameters; import org.opentripplanner.updater.spi.DataValidationExceptionMapper; import org.opentripplanner.updater.spi.UpdateError; @@ -56,9 +56,8 @@ public class SiriTimetableSnapshotSource implements TimetableSnapshotProvider { * messages. */ private final SiriTripPatternCache tripPatternCache; - private final TransitModel transitModel; - private final TransitService transitService; + private final TransitEditorService transitService; private final TimetableSnapshotManager snapshotManager; @@ -72,7 +71,6 @@ public SiriTimetableSnapshotSource( parameters, () -> LocalDate.now(transitModel.getTimeZone()) ); - this.transitModel = transitModel; this.transitService = new DefaultTransitService(transitModel); this.tripPatternCache = new SiriTripPatternCache(tripPatternIdGenerator, transitService::getPatternForTrip); @@ -115,7 +113,7 @@ public UpdateResult applyEstimatedTimetable( var journeys = estimatedJourneyVersion.getEstimatedVehicleJourneies(); LOG.debug("Handling {} EstimatedVehicleJourneys.", journeys.size()); for (EstimatedVehicleJourney journey : journeys) { - results.add(apply(journey, transitModel, fuzzyTripMatcher, entityResolver)); + results.add(apply(journey, transitService, fuzzyTripMatcher, entityResolver)); } } } @@ -135,7 +133,7 @@ public TimetableSnapshot getTimetableSnapshot() { private Result apply( EstimatedVehicleJourney journey, - TransitModel transitModel, + TransitEditorService transitService, @Nullable SiriFuzzyTripMatcher fuzzyTripMatcher, EntityResolver entityResolver ) { @@ -147,7 +145,7 @@ private Result apply( result = new AddedTripBuilder( journey, - transitModel, + transitService, entityResolver, tripPatternIdGenerator::generateUniqueTripPatternId ) @@ -265,7 +263,7 @@ private Result handleModifiedTrip( pattern, estimatedVehicleJourney, serviceDate, - transitModel.getTimeZone(), + transitService.getTimeZone(), entityResolver ) .build(); diff --git a/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java b/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java index ca88b7d3130..197860fc8a4 100644 --- a/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java +++ b/src/main/java/org/opentripplanner/transit/service/DefaultTransitService.java @@ -34,6 +34,7 @@ import org.opentripplanner.transit.model.basic.Notice; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; +import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.GroupOfRoutes; import org.opentripplanner.transit.model.network.Route; @@ -181,6 +182,10 @@ public Route getRouteForId(FeedScopedId id) { return this.transitModelIndex.getRouteForId(id); } + /** + * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix + * this when doing the issue #3030. + */ @Override public void addRoutes(Route route) { this.transitModelIndex.addRoutes(route); @@ -259,6 +264,15 @@ public Trip getTripForId(FeedScopedId id) { return this.transitModelIndex.getTripForId().get(id); } + /** + * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix + * this when doing the issue #3030. + */ + @Override + public void addTripForId(FeedScopedId tripId, Trip trip) { + transitModelIndex.getTripForId().put(tripId, trip); + } + @Override public Collection getAllTrips() { OTPRequestTimeoutException.checkForTimeout(); @@ -276,6 +290,15 @@ public TripPattern getPatternForTrip(Trip trip) { return this.transitModelIndex.getPatternForTrip().get(trip); } + /** + * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix + * this when doing the issue #3030. + */ + @Override + public void addPatternForTrip(Trip trip, TripPattern pattern) { + transitModelIndex.getPatternForTrip().put(trip, pattern); + } + @Override public TripPattern getPatternForTrip(Trip trip, LocalDate serviceDate) { TripPattern realtimePattern = getRealtimeAddedTripPattern(trip.getId(), serviceDate); @@ -291,6 +314,15 @@ public Collection getPatternsForRoute(Route route) { return this.transitModelIndex.getPatternsForRoute().get(route); } + /** + * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix + * this when doing the issue #3030. + */ + @Override + public void addPatternsForRoute(Route route, TripPattern pattern) { + transitModelIndex.getPatternsForRoute().put(route, pattern); + } + @Override public MultiModalStation getMultiModalStationForStation(Station station) { return this.transitModel.getStopModel().getMultiModalStationForStation(station); @@ -475,6 +507,15 @@ public TripOnServiceDate getTripOnServiceDateById(FeedScopedId datedServiceJourn return transitModelIndex.getTripOnServiceDateById().get(datedServiceJourneyId); } + /** + * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix + * this when doing the issue #3030. + */ + @Override + public void addTripOnServiceDateById(FeedScopedId id, TripOnServiceDate tripOnServiceDate) { + transitModelIndex.getTripOnServiceDateById().put(id, tripOnServiceDate); + } + @Override public Collection getAllTripOnServiceDates() { return transitModelIndex.getTripOnServiceDateForTripAndDay().values(); @@ -487,6 +528,29 @@ public TripOnServiceDate getTripOnServiceDateForTripAndDay( return transitModelIndex.getTripOnServiceDateForTripAndDay().get(tripIdAndServiceDate); } + /** + * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix + * this when doing the issue #3030. + */ + @Override + public void addTripOnServiceDateForTripAndDay( + TripIdAndServiceDate tripIdAndServiceDate, + TripOnServiceDate tripOnServiceDate + ) { + transitModelIndex + .getTripOnServiceDateForTripAndDay() + .put(tripIdAndServiceDate, tripOnServiceDate); + } + + /** + * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix + * this when doing the issue #3030. + */ + @Override + public FeedScopedId getOrCreateServiceIdForDate(LocalDate serviceDate) { + return transitModel.getOrCreateServiceIdForDate(serviceDate); + } + @Override public void addTransitMode(TransitMode mode) { this.transitModel.addTransitMode(mode); @@ -579,6 +643,11 @@ public List getModesOfStopLocation(StopLocation stop) { return sortByOccurrenceAndReduce(getPatternModesOfStop(stop)).toList(); } + @Override + public Deduplicator getDeduplicator() { + return transitModel.getDeduplicator(); + } + /** * For each pattern visiting this {@link StopLocation} return its {@link TransitMode} */ diff --git a/src/main/java/org/opentripplanner/transit/service/TransitEditorService.java b/src/main/java/org/opentripplanner/transit/service/TransitEditorService.java index 7d2f99df71b..6a11fe902f2 100644 --- a/src/main/java/org/opentripplanner/transit/service/TransitEditorService.java +++ b/src/main/java/org/opentripplanner/transit/service/TransitEditorService.java @@ -1,10 +1,16 @@ package org.opentripplanner.transit.service; +import java.time.LocalDate; import org.opentripplanner.model.FeedInfo; import org.opentripplanner.routing.algorithm.raptoradapter.transit.TransitLayer; import org.opentripplanner.transit.model.basic.TransitMode; +import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.Route; +import org.opentripplanner.transit.model.network.TripPattern; import org.opentripplanner.transit.model.organization.Agency; +import org.opentripplanner.transit.model.timetable.Trip; +import org.opentripplanner.transit.model.timetable.TripIdAndServiceDate; +import org.opentripplanner.transit.model.timetable.TripOnServiceDate; /** * Entry point for requests (both read-only and read-write) towards the transit API. @@ -14,9 +20,24 @@ public interface TransitEditorService extends TransitService { void addFeedInfo(FeedInfo info); + void addPatternForTrip(Trip trip, TripPattern pattern); + + void addPatternsForRoute(Route route, TripPattern pattern); + void addRoutes(Route route); void addTransitMode(TransitMode mode); + void addTripForId(FeedScopedId tripId, Trip trip); + + void addTripOnServiceDateById(FeedScopedId id, TripOnServiceDate tripOnServiceDate); + + void addTripOnServiceDateForTripAndDay( + TripIdAndServiceDate tripIdAndServiceDate, + TripOnServiceDate tripOnServiceDate + ); + + FeedScopedId getOrCreateServiceIdForDate(LocalDate serviceDate); + void setTransitLayer(TransitLayer transitLayer); } diff --git a/src/main/java/org/opentripplanner/transit/service/TransitModel.java b/src/main/java/org/opentripplanner/transit/service/TransitModel.java index d5211d5dd2e..27df0941c29 100644 --- a/src/main/java/org/opentripplanner/transit/service/TransitModel.java +++ b/src/main/java/org/opentripplanner/transit/service/TransitModel.java @@ -254,8 +254,6 @@ public void updateCalendarServiceData( * Get or create a serviceId for a given date. This method is used when a new trip is added from a * realtime data update. It make sure the date is in the existing transit service period. *

- * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix - * - this when doing the issue #3030. * * @param serviceDate service date for the added service id * @return service-id for date if it exist or is created. If the given service date is outside the diff --git a/src/main/java/org/opentripplanner/transit/service/TransitModelIndex.java b/src/main/java/org/opentripplanner/transit/service/TransitModelIndex.java index 84759ffae72..375e5c57b3d 100644 --- a/src/main/java/org/opentripplanner/transit/service/TransitModelIndex.java +++ b/src/main/java/org/opentripplanner/transit/service/TransitModelIndex.java @@ -126,10 +126,6 @@ public Route getRouteForId(FeedScopedId id) { return routeForId.get(id); } - /** - * TODO OTP2 - This is NOT THREAD-SAFE and is used in the real-time updaters, we need to fix - * - this when doing the issue #3030. - */ public void addRoutes(Route route) { routeForId.put(route.getId(), route); } diff --git a/src/main/java/org/opentripplanner/transit/service/TransitService.java b/src/main/java/org/opentripplanner/transit/service/TransitService.java index 83b65c44d12..8469f5ec186 100644 --- a/src/main/java/org/opentripplanner/transit/service/TransitService.java +++ b/src/main/java/org/opentripplanner/transit/service/TransitService.java @@ -25,6 +25,7 @@ import org.opentripplanner.transit.model.basic.Notice; import org.opentripplanner.transit.model.basic.TransitMode; import org.opentripplanner.transit.model.framework.AbstractTransitEntity; +import org.opentripplanner.transit.model.framework.Deduplicator; import org.opentripplanner.transit.model.framework.FeedScopedId; import org.opentripplanner.transit.model.network.GroupOfRoutes; import org.opentripplanner.transit.model.network.Route; @@ -231,4 +232,6 @@ List stopTimesForPatternAtStop( * So, if more patterns of mode BUS than RAIL visit the stop, the result will be [BUS,RAIL]. */ List getModesOfStopLocation(StopLocation stop); + + Deduplicator getDeduplicator(); } From 098123a06d344fbea7a84e6e7b3b3439b165b768 Mon Sep 17 00:00:00 2001 From: Vincent Paturet Date: Tue, 16 Jul 2024 11:57:05 +0200 Subject: [PATCH 2/2] Apply review suggestion --- .../ext/siri/AddedTripBuilderTest.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ext-test/java/org/opentripplanner/ext/siri/AddedTripBuilderTest.java b/src/ext-test/java/org/opentripplanner/ext/siri/AddedTripBuilderTest.java index 911fb015c27..e322b0ddea9 100644 --- a/src/ext-test/java/org/opentripplanner/ext/siri/AddedTripBuilderTest.java +++ b/src/ext-test/java/org/opentripplanner/ext/siri/AddedTripBuilderTest.java @@ -78,7 +78,7 @@ class AddedTripBuilderTest { private final Deduplicator DEDUPLICATOR = new Deduplicator(); private final TransitModel TRANSIT_MODEL = new TransitModel(STOP_MODEL, DEDUPLICATOR); - private TransitEditorService TRANSIT_SERVICE; + private TransitEditorService transitService; private EntityResolver ENTITY_RESOLVER; @BeforeEach @@ -103,7 +103,7 @@ void setUp() { // Create transit model index TRANSIT_MODEL.index(); - TRANSIT_SERVICE = new DefaultTransitService(TRANSIT_MODEL); + transitService = new DefaultTransitService(TRANSIT_MODEL); // Create the entity resolver only after the model has been indexed ENTITY_RESOLVER = @@ -113,7 +113,7 @@ void setUp() { @Test void testAddedTrip() { var addedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -242,7 +242,7 @@ void testAddedTrip() { @Test void testAddedTripOnAddedRoute() { var firstAddedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -268,7 +268,7 @@ void testAddedTripOnAddedRoute() { var tripId2 = TransitModelForTest.id("TRIP_ID_2"); var secondAddedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, tripId2, @@ -319,7 +319,7 @@ void testAddedTripOnAddedRoute() { @Test void testAddedTripOnExistingRoute() { var addedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -350,7 +350,7 @@ void testAddedTripOnExistingRoute() { @Test void testAddedTripWithoutReplacedRoute() { var addedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -393,7 +393,7 @@ void testAddedTripWithoutReplacedRoute() { @Test void testAddedTripFailOnMissingServiceId() { var addedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -448,7 +448,7 @@ void testAddedTripFailOnNonIncreasingDwellTime() { ); var addedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -487,7 +487,7 @@ void testAddedTripFailOnTooFewCalls() { .build() ); var addedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID, @@ -534,7 +534,7 @@ void testAddedTripFailOnUnknownStop() { .build() ); var addedTrip = new AddedTripBuilder( - TRANSIT_SERVICE, + transitService, ENTITY_RESOLVER, AbstractTransitEntity::getId, TRIP_ID,