fix(acceptance): close overseas dropship pallet chain

This commit is contained in:
2026-09-08 23:56:54 +08:00
parent fa9888d0e1
commit 5086de23a7
12 changed files with 50 additions and 15 deletions
@@ -399,7 +399,7 @@ class ReceivingContainerServiceBehaviorTest {
org.mockito.Mockito.reset(plans, lines, orders, sessions, operations, cartons, warehouse, pallets, workflow);
stubCurrent("OVERSEAS", "CONT-A");
when(cartons.selectOne(any())).thenReturn(carton(1L, "BOX-1"));
when(warehouse.resolvePallet("PAL-1")).thenReturn(resource(100L, null));
when(warehouse.inspectPallet("PAL-1")).thenReturn(resource(100L, null));
when(pallets.selectList(any())).thenReturn(List.of(planPallet()));
doThrow(new ResponseStatusException(org.springframework.http.HttpStatus.CONFLICT, "duplicate carton"))
.when(workflow).validateCartonResolved(any(), any(), any(), any(), any());
@@ -61,7 +61,7 @@ class PdaInventoryMoveServiceTest {
@Test
void atomicallyRelocatesPhysicalPalletAndEveryWarehouseScopedPosition() {
String targetLocationCode = "PDAOPS-ADMIN-API-20260825095854036-MOVE";
when(warehouse.resolvePallet("PAL-1")).thenReturn(pallet(900L, 20L, 2));
when(warehouse.inspectPallet("PAL-1")).thenReturn(pallet(900L, 20L, 2));
when(warehouse.resolveLocation(900L, 20L)).thenReturn(location(20L, "A-01"));
when(warehouse.resolveLocation(900L, targetLocationCode)).thenReturn(location(21L, targetLocationCode));
InventoryPosition position = new InventoryPosition(); position.setId(11L); position.setCustomerId("100");
@@ -101,7 +101,7 @@ class PdaInventoryMoveServiceTest {
@Test
void rejectsCrossWarehousePalletWithoutMovingResources() {
when(warehouse.resolvePallet("PAL-1")).thenReturn(pallet(901L, 20L, 2));
when(warehouse.inspectPallet("PAL-1")).thenReturn(pallet(901L, 20L, 2));
assertThatThrownBy(() -> service.move(900L, "operator-1",
new PdaInventoryMoveRequest("PAL-1", "B-01", 2, "move-1", "库位优化")))
.isInstanceOf(ResponseStatusException.class).hasMessageContaining("409");
@@ -110,7 +110,7 @@ class PdaInventoryMoveServiceTest {
@Test
void missingSourcePalletIsReportedAsNotFound() {
when(warehouse.resolvePallet("MISSING")).thenReturn(null);
when(warehouse.inspectPallet("MISSING")).thenReturn(null);
assertThatThrownBy(() -> service.move(900L, "operator-1",
new PdaInventoryMoveRequest("MISSING", "B-01", 2, "move-1", "库位优化")))
@@ -120,7 +120,7 @@ class PdaInventoryMoveServiceTest {
@Test
void resumesWhenWarehouseCommittedButLastlegTransactionRolledBack() {
when(warehouse.resolvePallet("PAL-1")).thenReturn(pallet(900L, 21L, 3));
when(warehouse.inspectPallet("PAL-1")).thenReturn(pallet(900L, 21L, 3));
when(warehouse.resolveLocation(900L, "B-01")).thenReturn(location(21L, "B-01"));
when(warehouse.resolveLocation(900L, 20L)).thenReturn(location(20L, "A-01"));
InventoryPosition position = new InventoryPosition(); position.setId(11L); position.setCustomerId("100");
@@ -90,7 +90,7 @@ class PdaStocktakeServiceTest {
@Test
void rejectsPalletFromAnotherWarehouseBeforeReadingInventory() {
when(warehouse.resolvePallet("PAL-1")).thenReturn(new WarehouseResourceGateway.WarehousePalletReference(
when(warehouse.inspectPallet("PAL-1")).thenReturn(new WarehouseResourceGateway.WarehousePalletReference(
30L, "PAL-1", 901L, 20L, "OCCUPIED", null, 2));
assertThatThrownBy(() -> service.create(900L, "operator-1",