test: complete held binding fixture
This commit is contained in:
+6
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user