fix(lastleg): inspect occupied pallets for PDA queries

This commit is contained in:
2026-09-08 23:34:12 +08:00
parent 3e15ad6b5b
commit 0c984e8f5f
7 changed files with 68 additions and 12 deletions
@@ -42,7 +42,7 @@ class PdaWarehouseServiceTest {
@Test
void palletFromAnotherWarehouseIsRejected() {
when(warehouse.resolvePallet("PAL-1")).thenReturn(new WarehouseResourceGateway.WarehousePalletReference(
when(warehouse.inspectPallet("PAL-1")).thenReturn(new WarehouseResourceGateway.WarehousePalletReference(
1L, "PAL-1", 901L, 2L, "OCCUPIED", null, 1));
assertThatThrownBy(() -> service.pallet(900L, new PdaWarehouseRequests.Scan("PAL-1")))
.isInstanceOf(ResponseStatusException.class).hasMessageContaining("409");
@@ -50,7 +50,7 @@ class PdaWarehouseServiceTest {
@Test
void missingPalletIsReportedAsNotFound() {
when(warehouse.resolvePallet("MISSING")).thenReturn(null);
when(warehouse.inspectPallet("MISSING")).thenReturn(null);
assertThatThrownBy(() -> service.pallet(900L, new PdaWarehouseRequests.Scan("MISSING")))
.isInstanceOf(ResponseStatusException.class).hasMessageContaining("404");