提交
This commit is contained in:
+13
@@ -5,6 +5,8 @@ import org.apache.ibatis.annotations.Select;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.sql.DriverManager;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -187,6 +189,17 @@ class DispatchCandidateMapperContractTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void relabelCandidatesReadWeightFromWarehouseTransferPalletSnapshot() throws Exception {
|
||||
String source = Files.readString(Path.of("src/main/java/com/baiyue/lastleg/dispatch/mapper/DispatchCandidateMapper.java"));
|
||||
int start = source.indexOf("List<DispatchPalletCandidate> relabelAvailable");
|
||||
int end = source.indexOf("List<DispatchPalletCandidate> nativeReturnRelabelAvailable");
|
||||
String sql = source.substring(source.lastIndexOf("@Select", start), end);
|
||||
assertTrue(sql.contains("MAX(wtp.gross_weight_kg) AS grossWeightKg"));
|
||||
assertTrue(sql.contains("MAX(wtp.volume_cbm) AS volumeCbm"));
|
||||
assertTrue(sql.contains("wtp.warehouse_pallet_id=pos.pallet_id"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void candidateGrossWeightUsesPhysicalSourcesAndNeverBillingVolumeWeight() throws Exception {
|
||||
for (Method method : List.of(
|
||||
|
||||
+3
@@ -65,11 +65,14 @@ class DispatchServiceTest {
|
||||
@Mock com.baiyue.lastleg.fleet.trip.FleetDispatchBindingGuard fleetBindings;
|
||||
@Mock com.baiyue.lastleg.fleet.trip.FleetDispatchWorkflowQuery fleetWorkflow;
|
||||
@Mock ReturnRelabelDispatchStock returnRelabelStock;
|
||||
@Mock com.baiyue.lastleg.relabel.service.RelabelPalletMeasurementService relabelMeasurements;
|
||||
private DispatchService service;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
service = new DispatchService();
|
||||
ReflectionTestUtils.setField(service, "relabelMeasurements", relabelMeasurements);
|
||||
lenient().when(relabelMeasurements.enrich(any())).thenAnswer(invocation -> invocation.getArgument(0));
|
||||
ReflectionTestUtils.setField(service, "fleetWorkflow", fleetWorkflow);
|
||||
ReflectionTestUtils.setField(service, "fleetBindings", fleetBindings);
|
||||
ReflectionTestUtils.setField(service, "returnRelabelStock", returnRelabelStock);
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ class PdaPalletOperationControllerContractTest {
|
||||
.filter(PostMapping.class::isInstance).map(PostMapping.class::cast)
|
||||
.flatMap(annotation -> Arrays.stream(annotation.value())).collect(Collectors.toSet());
|
||||
assertEquals(Set.of("/pallets/resolve", "/relabel-pallet-label", "/assemble", "/disassemble",
|
||||
"/relabel-disassemble", "/relabel-sources", "/swap", "/unbind"), paths);
|
||||
"/relabel-disassemble", "/relabel-sources", "/relabel-pallet-measure", "/relabel-pallet-measurements", "/swap", "/unbind"), paths);
|
||||
}
|
||||
|
||||
@Test void palletContentAnnotationUsesNativeGreaterThanOperator() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user