优化
This commit is contained in:
@@ -229,6 +229,32 @@ class LoadingPickServiceTest {
|
||||
verify(inboundHistories, never()).insert(any(InboundStatusHistoryEntity.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void taskDetailReturnsServerInboundAndLoadingVersions() {
|
||||
LoadingPickTaskEntity task = task();
|
||||
when(repository.task(20L)).thenReturn(task);
|
||||
when(repository.items(20L, 101L)).thenReturn(List.of(item()));
|
||||
when(repository.cartonLabels(20L)).thenReturn(List.of());
|
||||
when(repository.assignment(20L)).thenReturn(null);
|
||||
when(repository.review(20L)).thenReturn(null);
|
||||
when(repository.allTaskItemsResolved(20L)).thenReturn(false);
|
||||
when(repository.inboundOwners(20L)).thenReturn(List.of(
|
||||
new LoadingPickItemMapper.InboundOwner(101L, 50L)));
|
||||
when(repository.inbound(101L, 50L)).thenReturn(
|
||||
new LoadingInboundMapper.Snapshot(50L, 101L, "LOADING", 7));
|
||||
var plan = new com.baiyue.firstleg.entity.LoadingPlanEntity();
|
||||
plan.setId(10L); plan.setVersion(11);
|
||||
when(smartLoadingRepository.plan(10L)).thenReturn(plan);
|
||||
|
||||
var result = service.task(20L, 101L);
|
||||
|
||||
assertThat(result.inboundId()).isEqualTo(50L);
|
||||
assertThat(result.inboundVersion()).isEqualTo(7);
|
||||
assertThat(result.loadingVersion()).isEqualTo(11);
|
||||
assertThat(result.loadingPlanId()).isEqualTo(10L);
|
||||
assertThat(result.containerBookingId()).isEqualTo(99L);
|
||||
}
|
||||
|
||||
@Test
|
||||
void claimStartsLoadingAndSameOperatorReentryDoesNotDuplicateStartHistory() {
|
||||
LoadingPickTaskEntity task = task();
|
||||
|
||||
Reference in New Issue
Block a user