Skip to content

Commit

Permalink
Change test data journey pattern labels to match actual route DB dump…
Browse files Browse the repository at this point in the history
… labels

Not that it makes different regarding testing.
But in case these are used with real route DB dumps,
then updating the ids should be easier after this.
  • Loading branch information
Leitsi committed Oct 20, 2023
1 parent dab3280 commit 5bb539d
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
32 changes: 16 additions & 16 deletions src/test/resources/datasets/combine.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -38,8 +38,8 @@
}
]
},
"route123Inbound1": {
"_journey_pattern_ref_name": "route123Inbound",
"route133Inbound1": {
"_journey_pattern_ref_name": "route133Inbound",
"_passing_times": [
{
"_scheduled_stop_point_label": "H2204",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -146,8 +146,8 @@
}
]
},
"route234Outbound1": {
"_journey_pattern_ref_name": "route234Outbound",
"route241Outbound1": {
"_journey_pattern_ref_name": "route241Outbound",
"_passing_times": [
{
"_scheduled_stop_point_label": "K2201",
Expand All @@ -166,8 +166,8 @@
}
]
},
"route234Inbound1": {
"_journey_pattern_ref_name": "route234Inbound",
"route241VInbound1": {
"_journey_pattern_ref_name": "route241VInbound",
"_passing_times": [
{
"_scheduled_stop_point_label": "K2203",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
32 changes: 16 additions & 16 deletions src/test/resources/datasets/combine_multiple_targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -37,8 +37,8 @@
}
]
},
"route123Inbound1": {
"_journey_pattern_ref_name": "route123Inbound",
"route133Inbound1": {
"_journey_pattern_ref_name": "route133Inbound",
"_passing_times": [
{
"_scheduled_stop_point_label": "H2204",
Expand All @@ -62,8 +62,8 @@
}
]
},
"route234Outbound1": {
"_journey_pattern_ref_name": "route234Outbound",
"route241Outbound1": {
"_journey_pattern_ref_name": "route241Outbound",
"_passing_times": [
{
"_scheduled_stop_point_label": "K2201",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -163,8 +163,8 @@
}
]
},
"route234Inbound1": {
"_journey_pattern_ref_name": "route234Inbound",
"route241VInbound1": {
"_journey_pattern_ref_name": "route241VInbound",
"_passing_times": [
{
"_scheduled_stop_point_label": "K2203",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Loading

0 comments on commit 5bb539d

Please sign in to comment.