fix: close inbound hold bypass paths
This commit is contained in:
@@ -106,6 +106,30 @@ class LoadingPickServiceTest {
|
||||
@Resource
|
||||
private LoadingPickService service;
|
||||
|
||||
@Test
|
||||
void heldPlanBlocksDirectPdaItemSynchronizationBeforeTaskMutation() {
|
||||
doThrow(new BizException(com.baiyue.common.core.api.ResultCode.CONFLICT, "入库单已扣货"))
|
||||
.when(inboundHoldGuard).requirePlanNotHeld(10L);
|
||||
|
||||
assertThatThrownBy(() -> service.sync(10L, new LoadingPlanItemEntity()))
|
||||
.isInstanceOf(BizException.class).hasMessageContaining("扣货");
|
||||
|
||||
verify(repository, never()).taskByPlan(anyLong());
|
||||
}
|
||||
|
||||
@Test
|
||||
void heldTaskStopsDurableCompletionWorkerBeforeAnyFulfillmentReadOrWrite() {
|
||||
doThrow(new BizException(com.baiyue.common.core.api.ResultCode.CONFLICT, "入库单已扣货"))
|
||||
.when(inboundHoldGuard).requireTaskNotHeld(20L);
|
||||
|
||||
assertThatThrownBy(() -> service.processCompletion(
|
||||
completionCommand(999L, "held-worker"), "worker-held"))
|
||||
.isInstanceOf(BizException.class).hasMessageContaining("扣货");
|
||||
|
||||
verify(repository, never()).task(anyLong());
|
||||
verify(settlementService, never()).settleOwner(anyLong(), anyLong(), anyLong(), anyString());
|
||||
}
|
||||
|
||||
@BeforeEach
|
||||
void activeOperationalContainer() {
|
||||
doAnswer(invocation -> {
|
||||
|
||||
Reference in New Issue
Block a user