Test #1

Merged
admin merged 1726 commits from test into main 2026-09-17 11:52:45 +08:00
Showing only changes of commit 30e883fe0c - Show all commits
@@ -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);
}