fix(persistence): 差删先按 FDAY 圈定删除成员,修复保留航班明细误删 (ACM2-30)
This commit is contained in:
@@ -112,7 +112,6 @@ class FlightStateEngineTest {
|
||||
val commands = FlightStateEngine.commandsFromFields(
|
||||
"F1",
|
||||
mapOf("GTDT" to """[{"GTNO":"0"}]"""),
|
||||
snapshotReplace = false,
|
||||
)
|
||||
assertEquals(CollectionCommand.Clear, commands.collections["GTDT"])
|
||||
}
|
||||
@@ -123,7 +122,6 @@ class FlightStateEngineTest {
|
||||
FlightStateEngine.commandsFromFields(
|
||||
"F1",
|
||||
mapOf("GTDT" to """[{"GTNO":"1","GATE":"A1"},{"GTNO":"0"}]"""),
|
||||
snapshotReplace = false,
|
||||
)
|
||||
}.exceptionOrNull()
|
||||
assertTrue(error is IllegalArgumentException)
|
||||
@@ -138,7 +136,7 @@ class FlightStateEngineTest {
|
||||
1L,
|
||||
"m1",
|
||||
)
|
||||
val commands = FlightStateEngine.commandsFromFields("F1", mapOf("GTDT" to "[]"), snapshotReplace = false)
|
||||
val commands = FlightStateEngine.commandsFromFields("F1", mapOf("GTDT" to "[]"))
|
||||
val next = FlightStateEngine.apply(current, commands, "m2", bumpVersion = true)
|
||||
assertEquals(emptyList<Map<String, String>>(), next.collections["GTDT"])
|
||||
}
|
||||
@@ -175,7 +173,7 @@ class FlightStateEngineTest {
|
||||
3L,
|
||||
"m1",
|
||||
)
|
||||
val commands = FlightStateEngine.commandsFromFields("F1", mapOf("FRET" to "null"), snapshotReplace = false)
|
||||
val commands = FlightStateEngine.commandsFromFields("F1", mapOf("FRET" to "null"))
|
||||
assertEquals(ScalarCommand.Clear, commands.scalars["FRET"])
|
||||
|
||||
val next = FlightStateEngine.apply(current, commands, "m2", bumpVersion = true)
|
||||
@@ -186,7 +184,7 @@ class FlightStateEngineTest {
|
||||
// 非空载荷仍为 Set,且清空后的下一跳 Set 恢复键(clearedKeys 不跨消息携带)
|
||||
val restored = FlightStateEngine.apply(
|
||||
next,
|
||||
FlightStateEngine.commandsFromFields("F1", mapOf("FRET" to """{"REID":"R2"}"""), snapshotReplace = false),
|
||||
FlightStateEngine.commandsFromFields("F1", mapOf("FRET" to """{"REID":"R2"}""")),
|
||||
"m3",
|
||||
bumpVersion = true,
|
||||
)
|
||||
@@ -197,7 +195,7 @@ class FlightStateEngineTest {
|
||||
@Test
|
||||
fun `exception clear accepts null literal empty object and empty string`() {
|
||||
for (payload in listOf("null", "{}", "")) {
|
||||
val commands = FlightStateEngine.commandsFromFields("F1", mapOf("FDIV" to payload), snapshotReplace = false)
|
||||
val commands = FlightStateEngine.commandsFromFields("F1", mapOf("FDIV" to payload))
|
||||
assertEquals(ScalarCommand.Clear, commands.scalars["FDIV"], "payload=[$payload] must be Clear")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user