diff --git a/src/test/kotlin/fi/hsl/jore4/timetables/service/CombineTimetablesServiceTest.kt b/src/test/kotlin/fi/hsl/jore4/timetables/service/CombineTimetablesServiceTest.kt index 394a71c..5efc6ea 100644 --- a/src/test/kotlin/fi/hsl/jore4/timetables/service/CombineTimetablesServiceTest.kt +++ b/src/test/kotlin/fi/hsl/jore4/timetables/service/CombineTimetablesServiceTest.kt @@ -205,10 +205,10 @@ class CombineTimetablesServiceTest @Autowired constructor( val targetVehicleJourneys = targetBlock.getNested("_vehicle_journeys") stagingBlock["_vehicle_journeys"] = mutableMapOf( - "route123Outbound1" to stagingVehicleJourneys["route123Outbound1"] + "route133Outbound1" to stagingVehicleJourneys["route133Outbound1"] ) targetBlock["_vehicle_journeys"] = mutableMapOf( - "route234Outbound1" to targetVehicleJourneys["route234Outbound1"] + "route241Outbound1" to targetVehicleJourneys["route241Outbound1"] ) runCombineAndAssertTargetNotFoundException() @@ -279,14 +279,14 @@ class CombineTimetablesServiceTest @Autowired constructor( val targetVehicleJourneys = targetBlock.getNested("_vehicle_journeys") stagingBlock["_vehicle_journeys"] = mutableMapOf( - "route123Outbound1" to stagingVehicleJourneys["route123Outbound1"] + "route133Outbound1" to stagingVehicleJourneys["route133Outbound1"] ) targetBlock["_vehicle_journeys"] = mutableMapOf( // Identical vehicle journey as the one about to come from staging -> fail. - "route123Outbound1" to stagingVehicleJourneys["route123Outbound1"], + "route133Outbound1" to stagingVehicleJourneys["route133Outbound1"], // Some other routes that don't interfere. - "route123Outbound1" to targetVehicleJourneys["route123Outbound1"], - "route234Outbound1" to targetVehicleJourneys["route234Outbound1"] + "route133Outbound1" to targetVehicleJourneys["route133Outbound1"], + "route241Outbound1" to targetVehicleJourneys["route241Outbound1"] ) timetablesDataInserterRunner.truncateAndInsertDataset(testData.toJSONString()) val stagingFrameId = UUID.fromString("aa0e95c6-34d1-4d09-8546-3789b04ea494") diff --git a/src/test/kotlin/fi/hsl/jore4/timetables/service/ReplaceTimetablesServiceTest.kt b/src/test/kotlin/fi/hsl/jore4/timetables/service/ReplaceTimetablesServiceTest.kt index ee17dc8..be47e53 100644 --- a/src/test/kotlin/fi/hsl/jore4/timetables/service/ReplaceTimetablesServiceTest.kt +++ b/src/test/kotlin/fi/hsl/jore4/timetables/service/ReplaceTimetablesServiceTest.kt @@ -366,9 +366,9 @@ class ReplaceTimetablesServiceTest @Autowired constructor( @Test fun `when staging and replaced both have the same single route`() { val stagingFrameJourneys = - mutableMapOf("route123Outbound" to partialVehicleJourneys["route123Outbound1"]) + mutableMapOf("route133Outbound" to partialVehicleJourneys["route133Outbound1"]) val replacedFrameJourneys = - mutableMapOf("route123Outbound" to partialVehicleJourneys["route123Outbound2"]) + mutableMapOf("route133Outbound" to partialVehicleJourneys["route133Outbound2"]) setTestDataJourneys( stagingFrameJourneys = stagingFrameJourneys, replacedFrameJourneys = replacedFrameJourneys @@ -381,14 +381,14 @@ class ReplaceTimetablesServiceTest @Autowired constructor( @Test fun `when staging and replaced frame have all routes in common`() { val stagingFrameJourneys = mutableMapOf( - "route123Outbound" to partialVehicleJourneys["route123Outbound1"], - "route123Inbound" to partialVehicleJourneys["route123Inbound1"], - "route234Outbound" to partialVehicleJourneys["route234Outbound1"] + "route133Outbound" to partialVehicleJourneys["route133Outbound1"], + "route133Inbound" to partialVehicleJourneys["route133Inbound1"], + "route241Outbound" to partialVehicleJourneys["route241Outbound1"] ) val replacedFrameJourneys = mutableMapOf( - "route123Outbound" to partialVehicleJourneys["route123Outbound2"], - "route123Inbound" to partialVehicleJourneys["route123Inbound2"], - "route234Outbound" to partialVehicleJourneys["route234Outbound2"] + "route133Outbound" to partialVehicleJourneys["route133Outbound2"], + "route133Inbound" to partialVehicleJourneys["route133Inbound2"], + "route241Outbound" to partialVehicleJourneys["route241Outbound2"] ) setTestDataJourneys( stagingFrameJourneys = stagingFrameJourneys, @@ -402,13 +402,13 @@ class ReplaceTimetablesServiceTest @Autowired constructor( @Test fun `when staging and replaced frame have some routes in common, but staging has additional ones`() { val stagingFrameJourneys = mutableMapOf( - "route123Outbound" to partialVehicleJourneys["route123Outbound1"], - "route123Inbound" to partialVehicleJourneys["route123Inbound1"], - "route234Outbound" to partialVehicleJourneys["route234Outbound1"] + "route133Outbound" to partialVehicleJourneys["route133Outbound1"], + "route133Inbound" to partialVehicleJourneys["route133Inbound1"], + "route241Outbound" to partialVehicleJourneys["route241Outbound1"] ) val replacedFrameJourneys = mutableMapOf( - "route123Outbound" to partialVehicleJourneys["route123Outbound2"], - "route123Inbound" to partialVehicleJourneys["route123Inbound2"] + "route133Outbound" to partialVehicleJourneys["route133Outbound2"], + "route133Inbound" to partialVehicleJourneys["route133Inbound2"] ) setTestDataJourneys( stagingFrameJourneys = stagingFrameJourneys, @@ -422,12 +422,12 @@ class ReplaceTimetablesServiceTest @Autowired constructor( @Test fun `when staging and replaced frame have some routes in common, but replaced has additional ones`() { val stagingFrameJourneys = mutableMapOf( - "route234Outbound" to partialVehicleJourneys["route234Outbound1"] + "route241Outbound" to partialVehicleJourneys["route241Outbound1"] ) val replacedFrameJourneys = mutableMapOf( - "route123Outbound" to partialVehicleJourneys["route123Outbound2"], - "route123Inbound" to partialVehicleJourneys["route123Inbound2"], - "route234Outbound" to partialVehicleJourneys["route234Outbound2"] + "route133Outbound" to partialVehicleJourneys["route133Outbound2"], + "route133Inbound" to partialVehicleJourneys["route133Inbound2"], + "route241Outbound" to partialVehicleJourneys["route241Outbound2"] ) setTestDataJourneys( stagingFrameJourneys = stagingFrameJourneys, @@ -667,12 +667,12 @@ class ReplaceTimetablesServiceTest @Autowired constructor( @Test fun `does not return a frame with no shared routes`() { val stagingFrameJourneys = mutableMapOf( - "route123Outbound" to partialVehicleJourneys["route123Outbound1"], - "route123Inbound" to partialVehicleJourneys["route123Inbound1"] + "route133Outbound" to partialVehicleJourneys["route133Outbound1"], + "route133Inbound" to partialVehicleJourneys["route133Inbound1"] ) val replacedFrameJourneys = mutableMapOf( - "route234Outbound" to partialVehicleJourneys["route234Outbound2"], - "route234Inbound" to partialVehicleJourneys["route234Inbound2"] + "route241Outbound" to partialVehicleJourneys["route241Outbound2"], + "route241VInbound" to partialVehicleJourneys["route241VInbound2"] ) setTestDataJourneys( stagingFrameJourneys = stagingFrameJourneys, diff --git a/src/test/resources/datasets/combine.json b/src/test/resources/datasets/combine.json index b3b337c..64bcced 100644 --- a/src/test/resources/datasets/combine.json +++ b/src/test/resources/datasets/combine.json @@ -13,8 +13,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -38,8 +38,8 @@ } ] }, - "route123Inbound1": { - "_journey_pattern_ref_name": "route123Inbound", + "route133Inbound1": { + "_journey_pattern_ref_name": "route133Inbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2204", @@ -82,8 +82,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route234Outbound1": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound1": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -121,8 +121,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -146,8 +146,8 @@ } ] }, - "route234Outbound1": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound1": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -166,8 +166,8 @@ } ] }, - "route234Inbound1": { - "_journey_pattern_ref_name": "route234Inbound", + "route241VInbound1": { + "_journey_pattern_ref_name": "route241VInbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2203", @@ -194,7 +194,7 @@ } }, "_journey_pattern_refs": { - "route123Outbound": { + "route133Outbound": { "journey_pattern_id": "4b070731-700d-4c4c-8e30-cd177fa80ada", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-07-01T00:00:00+00:00", @@ -223,7 +223,7 @@ } ] }, - "route123Inbound": { + "route133Inbound": { "journey_pattern_id": "0d05d12f-cf7b-47f8-961c-edb89b789e1d", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-07-01T00:00:00+00:00", @@ -253,7 +253,7 @@ ] }, - "route234Outbound": { + "route241Outbound": { "journey_pattern_id": "c04e7d84-0241-4355-9860-5eab55041434", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-06-01T00:00:00+00:00", @@ -278,7 +278,7 @@ } ] }, - "route234Inbound": { + "route241VInbound": { "journey_pattern_id": "a2490f53-cd16-488e-ad7c-0cdeae541b39", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-06-01T00:00:00+00:00", diff --git a/src/test/resources/datasets/combine_multiple_targets.json b/src/test/resources/datasets/combine_multiple_targets.json index 8b9a4f4..ea02c68 100644 --- a/src/test/resources/datasets/combine_multiple_targets.json +++ b/src/test/resources/datasets/combine_multiple_targets.json @@ -12,8 +12,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -37,8 +37,8 @@ } ] }, - "route123Inbound1": { - "_journey_pattern_ref_name": "route123Inbound", + "route133Inbound1": { + "_journey_pattern_ref_name": "route133Inbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2204", @@ -62,8 +62,8 @@ } ] }, - "route234Outbound1": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound1": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -100,8 +100,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -143,8 +143,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route234Outbound1": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound1": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -163,8 +163,8 @@ } ] }, - "route234Inbound1": { - "_journey_pattern_ref_name": "route234Inbound", + "route241VInbound1": { + "_journey_pattern_ref_name": "route241VInbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2203", @@ -191,7 +191,7 @@ } }, "_journey_pattern_refs": { - "route123Outbound": { + "route133Outbound": { "journey_pattern_id": "4b070731-700d-4c4c-8e30-cd177fa80ada", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-07-01T00:00:00+00:00", @@ -220,7 +220,7 @@ } ] }, - "route123Inbound": { + "route133Inbound": { "journey_pattern_id": "0d05d12f-cf7b-47f8-961c-edb89b789e1d", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-07-01T00:00:00+00:00", @@ -250,7 +250,7 @@ ] }, - "route234Outbound": { + "route241Outbound": { "journey_pattern_id": "c04e7d84-0241-4355-9860-5eab55041434", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-06-01T00:00:00+00:00", @@ -275,7 +275,7 @@ } ] }, - "route234Inbound": { + "route241VInbound": { "journey_pattern_id": "a2490f53-cd16-488e-ad7c-0cdeae541b39", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-06-01T00:00:00+00:00", diff --git a/src/test/resources/datasets/partial_vehicle_journeys.json b/src/test/resources/datasets/partial_vehicle_journeys.json index 573f625..b4d69f5 100644 --- a/src/test/resources/datasets/partial_vehicle_journeys.json +++ b/src/test/resources/datasets/partial_vehicle_journeys.json @@ -1,6 +1,6 @@ { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -24,8 +24,8 @@ } ] }, - "route123Outbound2": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound2": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -49,8 +49,8 @@ } ] }, - "route123Inbound1": { - "_journey_pattern_ref_name": "route123Inbound", + "route133Inbound1": { + "_journey_pattern_ref_name": "route133Inbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2204", @@ -74,8 +74,8 @@ } ] }, - "route123Inbound2": { - "_journey_pattern_ref_name": "route123Inbound", + "route133Inbound2": { + "_journey_pattern_ref_name": "route133Inbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2204", @@ -99,8 +99,8 @@ } ] }, - "route234Outbound1": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound1": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -119,8 +119,8 @@ } ] }, - "route234Outbound2": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound2": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -139,8 +139,8 @@ } ] }, - "route234Inbound1": { - "_journey_pattern_ref_name": "route234Inbound", + "route241VInbound1": { + "_journey_pattern_ref_name": "route241VInbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2203", @@ -159,8 +159,8 @@ } ] }, - "route234Inbound2": { - "_journey_pattern_ref_name": "route234Inbound", + "route241VInbound2": { + "_journey_pattern_ref_name": "route241VInbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2203", diff --git a/src/test/resources/datasets/replace.json b/src/test/resources/datasets/replace.json index 1508ac6..b13d281 100644 --- a/src/test/resources/datasets/replace.json +++ b/src/test/resources/datasets/replace.json @@ -12,8 +12,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -37,8 +37,8 @@ } ] }, - "route123Inbound1": { - "_journey_pattern_ref_name": "route123Inbound", + "route133Inbound1": { + "_journey_pattern_ref_name": "route133Inbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2204", @@ -80,8 +80,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -105,8 +105,8 @@ } ] }, - "route234Outbound1": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound1": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -125,8 +125,8 @@ } ] }, - "route234Inbound1": { - "_journey_pattern_ref_name": "route234Inbound", + "route241VInbound1": { + "_journey_pattern_ref_name": "route241VInbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2203", @@ -153,7 +153,7 @@ } }, "_journey_pattern_refs": { - "route123Outbound": { + "route133Outbound": { "journey_pattern_id": "4b070731-700d-4c4c-8e30-cd177fa80ada", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-07-01T00:00:00+00:00", @@ -182,7 +182,7 @@ } ] }, - "route123Inbound": { + "route133Inbound": { "journey_pattern_id": "0d05d12f-cf7b-47f8-961c-edb89b789e1d", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-07-01T00:00:00+00:00", @@ -212,7 +212,7 @@ ] }, - "route234Outbound": { + "route241Outbound": { "journey_pattern_id": "c04e7d84-0241-4355-9860-5eab55041434", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-06-01T00:00:00+00:00", @@ -237,7 +237,7 @@ } ] }, - "route234Inbound": { + "route241VInbound": { "journey_pattern_id": "a2490f53-cd16-488e-ad7c-0cdeae541b39", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-06-01T00:00:00+00:00", diff --git a/src/test/resources/datasets/replace_multiple_replaced.json b/src/test/resources/datasets/replace_multiple_replaced.json index 752717d..b42e627 100644 --- a/src/test/resources/datasets/replace_multiple_replaced.json +++ b/src/test/resources/datasets/replace_multiple_replaced.json @@ -12,8 +12,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -37,8 +37,8 @@ } ] }, - "route123Inbound1": { - "_journey_pattern_ref_name": "route123Inbound", + "route133Inbound1": { + "_journey_pattern_ref_name": "route133Inbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2204", @@ -62,8 +62,8 @@ } ] }, - "route234Outbound1": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound1": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -100,8 +100,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route123Outbound1": { - "_journey_pattern_ref_name": "route123Outbound", + "route133Outbound1": { + "_journey_pattern_ref_name": "route133Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "H2201", @@ -143,8 +143,8 @@ "_blocks": { "block": { "_vehicle_journeys": { - "route234Outbound1": { - "_journey_pattern_ref_name": "route234Outbound", + "route241Outbound1": { + "_journey_pattern_ref_name": "route241Outbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2201", @@ -163,8 +163,8 @@ } ] }, - "route234Inbound1": { - "_journey_pattern_ref_name": "route234Inbound", + "route241VInbound1": { + "_journey_pattern_ref_name": "route241VInbound", "_passing_times": [ { "_scheduled_stop_point_label": "K2203", @@ -191,7 +191,7 @@ } }, "_journey_pattern_refs": { - "route123Outbound": { + "route133Outbound": { "journey_pattern_id": "4b070731-700d-4c4c-8e30-cd177fa80ada", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-07-01T00:00:00+00:00", @@ -219,7 +219,7 @@ } ] }, - "route123Inbound": { + "route133Inbound": { "journey_pattern_id": "0d05d12f-cf7b-47f8-961c-edb89b789e1d", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-07-01T00:00:00+00:00", @@ -247,7 +247,7 @@ } ] }, - "route234Outbound": { + "route241Outbound": { "journey_pattern_id": "c04e7d84-0241-4355-9860-5eab55041434", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-06-01T00:00:00+00:00", @@ -271,7 +271,7 @@ } ] }, - "route234Inbound": { + "route241VInbound": { "journey_pattern_id": "a2490f53-cd16-488e-ad7c-0cdeae541b39", "type_of_line": "stopping_bus_service", "observation_timestamp": "2023-06-01T00:00:00+00:00",