提交
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(
|
||||
|
||||
Reference in New Issue
Block a user