From 30e883fe0ce69f6eccda4eec76ea8c4d37e9a07e Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Mon, 7 Sep 2026 12:17:56 +0800 Subject: [PATCH] test: complete held binding fixture --- .../bridge/service/LoadingModelBridgeServiceTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firstleg/src/test/java/com/baiyue/firstleg/loading/bridge/service/LoadingModelBridgeServiceTest.java b/firstleg/src/test/java/com/baiyue/firstleg/loading/bridge/service/LoadingModelBridgeServiceTest.java index 5aeaa7465..67d4b2ed2 100644 --- a/firstleg/src/test/java/com/baiyue/firstleg/loading/bridge/service/LoadingModelBridgeServiceTest.java +++ b/firstleg/src/test/java/com/baiyue/firstleg/loading/bridge/service/LoadingModelBridgeServiceTest.java @@ -36,6 +36,10 @@ class LoadingModelBridgeServiceTest { .when(inboundHoldGuard).requireInboundNotHeld(10L, 20L); doThrow(new BizException(ResultCode.CONFLICT, "入库单已扣货")) .when(inboundHoldGuard).requirePlanNotHeld(40L); + when(repository.loadingPlan(40L)).thenReturn( + new LoadingPlanSnapshot(40L, 50L, "C1", "EDITING", 1)); + when(repository.allocatedScopes(40L)).thenReturn( + List.of(new AllocationScope(10L, 20L, 1, "WAIT_SPLIT"))); assertThatThrownBy(() -> service.bind(10L, 20L, 40L, 7L, "admin", "bind-held", new BindRequest(1, 1))).isInstanceOf(BizException.class).hasMessageContaining("扣货"); @@ -46,8 +50,9 @@ class LoadingModelBridgeServiceTest { .isInstanceOf(BizException.class).hasMessageContaining("扣货"); verify(repository).byIdempotency(7L, "bind-held"); - verify(repository, times(2)).byPair(10L, 20L, 40L); + verify(repository, times(3)).byPair(10L, 20L, 40L); verify(repository).loadingPlan(40L); + verify(repository).allocatedScopes(40L); verifyNoMoreInteractions(repository); }