feat: enforce canonical container identity across regions
This commit is contained in:
+14
-1
@@ -204,8 +204,21 @@ class LastlegOrderServiceTest {
|
||||
verify(orders).findContainerProgressItems("BOOKING-1");
|
||||
}
|
||||
|
||||
@Test
|
||||
void containerProgressDetailFailsClosedWhenContainerNumberFactHasDrifted() {
|
||||
var drifted = new ContainerPlanProgressSummary("BOOKING-1", null, 2, 2, 0,
|
||||
2, 2, 0, LocalDateTime.of(2026, 10, 3, 9, 0), false, "柜号缺失或不一致");
|
||||
when(orders.findContainerProgress("BOOKING-1")).thenReturn(drifted);
|
||||
|
||||
ResponseStatusException error = assertThrows(ResponseStatusException.class,
|
||||
() -> service.containerProgressDetail("BOOKING-1"));
|
||||
|
||||
assertEquals(409, error.getStatusCode().value());
|
||||
verify(orders, never()).findContainerProgressItems(any());
|
||||
}
|
||||
|
||||
private static ContainerPlanProgressSummary summary(boolean ready, long pending, String reason) {
|
||||
return new ContainerPlanProgressSummary("BOOKING-1", "CONT-1", 15, 15, 0,
|
||||
return new ContainerPlanProgressSummary("BOOKING-1", "MSCU6639870", 15, 15, 0,
|
||||
15 - pending, 15 - pending, pending, LocalDateTime.of(2026, 10, 3, 9, 0), ready, reason);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user