fix(firstleg): retain declaration event idempotency history

This commit is contained in:
2026-09-02 10:44:17 +08:00
parent 8e7835fe86
commit bb9fb9ffe6
4 changed files with 42 additions and 4 deletions
@@ -69,6 +69,7 @@ class OrderDeclarationSyncServiceTest {
when(mapper.lockInbound(10001L, 77L)).thenReturn(row("WAIT_MEASURE", null, null, null, null));
when(mapper.insertSnapshot(anyLong(), anyLong(), anyString(), anyInt(), anyString(), any(), any(),
anyString(), anyString(), anyString(), anyString(), any())).thenReturn(1);
when(mapper.insertConsumedEvent(anyLong(), anyString(), anyLong(), anyInt(), anyString())).thenReturn(1);
when(mapper.updateAllowedSnapshot(10001L, 88L, 77L, "FL-77", "RK-77", "客户新备注",
event.expectedArrivalAt(), "MATSON_NEW", "新渠道", 9L)).thenReturn(1);
@@ -84,6 +85,7 @@ class OrderDeclarationSyncServiceTest {
when(mapper.lockInbound(10001L, 77L)).thenReturn(row("WAIT_MEASURE", null, null, null, null));
when(mapper.lockSnapshot(10001L, 77L)).thenReturn(
new OrderDeclarationSyncMapper.SnapshotRow(10001L, 77L, "event-5", 5, "hash"));
when(mapper.insertConsumedEvent(anyLong(), anyString(), anyLong(), anyInt(), anyString())).thenReturn(1);
service.consume(event);
@@ -91,6 +93,7 @@ class OrderDeclarationSyncServiceTest {
any(), anyString(), anyString(), anyString(), anyString(), any());
verify(mapper, never()).updateAllowedSnapshot(anyLong(), anyLong(), anyLong(), anyString(), anyString(),
any(), any(), anyString(), anyString(), anyLong());
verify(mapper).insertConsumedEvent(anyLong(), anyString(), anyLong(), anyInt(), anyString());
}
@Test