Merge branch 'test' of http://8.163.30.128:10082/java-project/baiyue-firstleg into dev
This commit is contained in:
@@ -17,6 +17,7 @@ import com.baiyue.firstleg.mapper.InboundPalletAllocationMapper;
|
||||
import com.baiyue.firstleg.mapper.InboundStatusHistoryMapper;
|
||||
import com.baiyue.firstleg.mapper.InboundTransportSnapshotMapper;
|
||||
import com.baiyue.firstleg.mapper.InboundPickupSnapshotMapper;
|
||||
import com.baiyue.firstleg.mapper.InboundWeightResultMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.apache.ibatis.builder.MapperBuilderAssistant;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
@@ -43,6 +44,7 @@ class InboundOrderRepositoryTest {
|
||||
@MockBean private InboundFileMapper files;
|
||||
@MockBean private InboundInternalNoteMapper notes;
|
||||
@MockBean private InboundStatusHistoryMapper histories;
|
||||
@MockBean private InboundWeightResultMapper weights;
|
||||
@Resource private InboundOrderRepository repository;
|
||||
@Test
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
|
||||
+3
-1
@@ -108,7 +108,9 @@ class TenantScopedMutationRepositoryTest {
|
||||
verify(inboundOrders).update(eq(inbound), wrapper.capture());
|
||||
assertTenantAndId(wrapper.getValue());
|
||||
assertThat(((LambdaUpdateWrapper<InboundOrderEntity>) wrapper.getValue()).getSqlSet())
|
||||
.contains("actual_gross_weight_kg");
|
||||
.contains("actual_gross_weight_kg")
|
||||
.contains("actual_net_weight_kg")
|
||||
.contains("pallet_count");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -123,6 +123,7 @@ class InboundMeasurementServiceTest {
|
||||
assertThat(weight.getNetWeightKg()).isNull();
|
||||
assertThat(inbound.getActualGrossWeightKg()).isNull();
|
||||
assertThat(inbound.getActualNetWeightKg()).isNull();
|
||||
assertThat(inbound.getPalletCount()).isZero();
|
||||
verify(repository).updateInboundWeightSummary(inbound);
|
||||
}
|
||||
|
||||
@@ -283,6 +284,7 @@ class InboundMeasurementServiceTest {
|
||||
assertThat(response.netWeightKg()).isEqualByComparingTo("4.536");
|
||||
assertThat(inbound.getActualGrossWeightKg()).isEqualByComparingTo("6.536");
|
||||
assertThat(inbound.getActualNetWeightKg()).isEqualByComparingTo("6.536");
|
||||
assertThat(inbound.getPalletCount()).isEqualTo(2);
|
||||
assertThat(inbound.getProcessStatus()).isEqualTo("MEASURING");
|
||||
verify(repository).insertRevision(any(InboundWeightRevisionEntity.class));
|
||||
}
|
||||
@@ -630,6 +632,7 @@ class InboundMeasurementServiceTest {
|
||||
|
||||
assertThat(inbound.getActualGrossWeightKg()).isNull();
|
||||
assertThat(inbound.getActualNetWeightKg()).isNull();
|
||||
assertThat(inbound.getPalletCount()).isZero();
|
||||
verify(repository).updateInboundWeightSummary(inbound);
|
||||
}
|
||||
|
||||
@@ -655,6 +658,7 @@ class InboundMeasurementServiceTest {
|
||||
|
||||
assertThat(inbound.getActualGrossWeightKg()).isEqualByComparingTo("5.000");
|
||||
assertThat(inbound.getActualNetWeightKg()).isEqualByComparingTo("5.000");
|
||||
assertThat(inbound.getPalletCount()).isEqualTo(1);
|
||||
verify(repository).updateInboundWeightSummary(inbound);
|
||||
}
|
||||
|
||||
|
||||
+15
@@ -13,6 +13,7 @@ import org.junit.jupiter.params.provider.ValueSource;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verifyNoInteractions;
|
||||
@@ -71,6 +72,20 @@ class UnifiedInboundQueryServiceTest {
|
||||
assertThat(UnifiedInboundQueryService.requiresPhaseThreeSummary("DELIVERED")).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void completedHistoricalInboundUsesConfirmedWeightCountWhenStoredPalletCountIsZero() throws Exception {
|
||||
InboundOrderEntity inbound = new InboundOrderEntity();
|
||||
inbound.setId(88L);
|
||||
inbound.setPalletCount(0);
|
||||
var method = UnifiedInboundQueryService.class.getDeclaredMethod(
|
||||
"applyConfirmedPalletCount", InboundOrderEntity.class, Map.class);
|
||||
method.setAccessible(true);
|
||||
|
||||
method.invoke(null, inbound, Map.of(88L, 2));
|
||||
|
||||
assertThat(inbound.getPalletCount()).isEqualTo(2);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"WAIT_MEASURE", "WAIT_SPLIT"})
|
||||
void phaseTwoDetailDoesNotQueryPhaseThreeTables(String processStatus) {
|
||||
|
||||
Reference in New Issue
Block a user