优化
This commit is contained in:
+9
-2
@@ -52,13 +52,20 @@ class FirstLegLoadingPlanCompletedV1Test {
|
||||
void legacyParserRetainsDestinationTypeWhenV2OrderCarriesIt() throws Exception {
|
||||
String json = """
|
||||
{"loadingPlanId":"1","planNo":"LP-1","containerBookingId":"2","containerNo":"CONT-1",
|
||||
"warehouseId":"3","warehouseName":"海外仓","orders":[{"sourceInboundId":"100",
|
||||
"destinationWarehouseId":"3","packageCount":1,"items":[],"customerId":"9001",
|
||||
"warehouseId":"3","warehouseName":"海外仓","estimatedPortArrivalAt":"2026-09-30T12:00",
|
||||
"actualPortArrivalAt":null,"estimatedWarehouseArrivalAt":"2026-10-03T09:00",
|
||||
"orders":[{"sourceInboundId":"100","destinationWarehouseId":"3","packageCount":1,
|
||||
"palletCount":2,"volumeWeightKg":12.500,"items":[],"customerId":"9001",
|
||||
"customerName":"客户甲","destinationType":"OVERSEAS"}]}
|
||||
""";
|
||||
|
||||
FirstLegLoadingPlanCompletedV1 restored = mapper.readValue(json, FirstLegLoadingPlanCompletedV1.class);
|
||||
|
||||
assertThat(restored.orders().get(0).destinationType()).isEqualTo("OVERSEAS");
|
||||
assertThat(restored.estimatedPortArrivalAt()).isEqualTo("2026-09-30T12:00");
|
||||
assertThat(restored.actualPortArrivalAt()).isNull();
|
||||
assertThat(restored.estimatedWarehouseArrivalAt()).isEqualTo("2026-10-03T09:00");
|
||||
assertThat(restored.orders().get(0).palletCount()).isEqualTo(2);
|
||||
assertThat(restored.orders().get(0).volumeWeightKg()).isEqualByComparingTo("12.500");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user