@@ -1013,7 +1013,7 @@ private TripPattern assertAddedTrip(
1013
1013
boolean forceSnapshotCommit
1014
1014
) {
1015
1015
var stopA = transitModel .getStopModel ().getRegularStop (new FeedScopedId (feedId , "A" ));
1016
- // Get trip pattern of last (most recently added) outgoing edge
1016
+ // Get the trip pattern of the added trip which goes through stopA
1017
1017
var snapshot = updater .getTimetableSnapshot (forceSnapshotCommit );
1018
1018
var patternsAtA = snapshot .getPatternsForStop (stopA );
1019
1019
@@ -1184,7 +1184,7 @@ public void repeatedlyAddedTripWithNewRoute() {
1184
1184
assertNotNull (transitModel .getTransitModelIndex ().getRouteForId (firstRoute .getId ()));
1185
1185
}
1186
1186
1187
- static List <Arguments > addedRemovalTestCase () {
1187
+ static List <Arguments > cancelingAddedTripTestCases () {
1188
1188
return List .of (
1189
1189
// TODO we might want to change the behaviour so that only the trip without pattern is
1190
1190
// persisted if the added trip is cancelled
@@ -1204,7 +1204,7 @@ static List<Arguments> addedRemovalTestCase() {
1204
1204
* added by realtime data be present in the trip pattern for scheduled service.
1205
1205
*/
1206
1206
@ ParameterizedTest
1207
- @ MethodSource ("addedRemovalTestCase " )
1207
+ @ MethodSource ("cancelingAddedTripTestCases " )
1208
1208
public void cancelingAddedTrip (
1209
1209
ScheduleRelationship scheduleRelationship ,
1210
1210
RealTimeState expectedState
@@ -1234,8 +1234,6 @@ public void cancelingAddedTrip(
1234
1234
// THEN
1235
1235
assertAddedTrip (SERVICE_DATE , this .addedTripId , updater , true );
1236
1236
1237
- builder = new TripUpdateBuilder (addedTripId , SERVICE_DATE , ADDED , transitModel .getTimeZone ());
1238
-
1239
1237
var tripDescriptorBuilder = TripDescriptor .newBuilder ();
1240
1238
tripDescriptorBuilder .setTripId (addedTripId );
1241
1239
tripDescriptorBuilder .setScheduleRelationship (scheduleRelationship );
@@ -1253,9 +1251,9 @@ public void cancelingAddedTrip(
1253
1251
);
1254
1252
1255
1253
// THEN
1256
- // Get trip pattern of last (most recently added) outgoing edge
1257
1254
var snapshot = updater .getTimetableSnapshot (true );
1258
1255
var stopA = transitModel .getStopModel ().getRegularStop (new FeedScopedId (feedId , "A" ));
1256
+ // Get the trip pattern of the added trip which goes through stopA
1259
1257
var patternsAtA = snapshot .getPatternsForStop (stopA );
1260
1258
1261
1259
assertNotNull (patternsAtA , "Added trip pattern should be found" );
@@ -1269,7 +1267,7 @@ public void cancelingAddedTrip(
1269
1267
final int forTodayAddedTripIndex = forToday .getTripIndex (addedTripId );
1270
1268
assertTrue (
1271
1269
forTodayAddedTripIndex > -1 ,
1272
- "Added trip should not be found in time table for service date"
1270
+ "Added trip should be found in time table for the service date"
1273
1271
);
1274
1272
assertEquals (expectedState , forToday .getTripTimes (forTodayAddedTripIndex ).getRealTimeState ());
1275
1273
0 commit comments