修改提交
This commit is contained in:
+19
@@ -68,6 +68,25 @@ class LoadingCompletedOutboxServiceTest {
|
||||
.hasMessageContaining("缺少 SKU");
|
||||
}
|
||||
|
||||
@Test void freezesExactlyLoadedPackagesFromLabelPoolDeterministically() throws Exception {
|
||||
Row value = row(11, 100, 101);
|
||||
value.setPackageCount(2);
|
||||
when(snapshots.rows(90L)).thenReturn(List.of(value));
|
||||
when(manifests.labelPool(11L, 100L, 101L)).thenReturn(
|
||||
List.of("BOX-001", "BOX-002", "BOX-003", "BOX-004"));
|
||||
|
||||
service.publish(90L);
|
||||
service.publish(90L);
|
||||
|
||||
ArgumentCaptor<InboundOutboxEntity> captor = ArgumentCaptor.forClass(InboundOutboxEntity.class);
|
||||
verify(outbox, org.mockito.Mockito.times(2)).insert(captor.capture());
|
||||
EventEnvelope first = mapper.readValue(captor.getAllValues().get(0).getPayloadJson(), EventEnvelope.class);
|
||||
EventEnvelope second = mapper.readValue(captor.getAllValues().get(1).getPayloadJson(), EventEnvelope.class);
|
||||
assertThat(first.payload().at("/orders/0/items/0/cartonMarks")).hasSize(2);
|
||||
assertThat(first.payload().at("/orders/0/items/0/cartonMarks"))
|
||||
.isEqualTo(second.payload().at("/orders/0/items/0/cartonMarks"));
|
||||
}
|
||||
|
||||
@Test void snapshotOnlyPublishesFinalizedLoadedInbounds() throws Exception {
|
||||
String sql = String.join(" ", LoadingCompletedEventMapper.class.getMethod("rows", long.class)
|
||||
.getAnnotation(Select.class).value()).replaceAll("\\s+", " ");
|
||||
|
||||
Reference in New Issue
Block a user