test(firstleg): align customs contract assertions

This commit is contained in:
2026-08-28 16:59:43 +08:00
parent 603bd29cc2
commit 9664aa4bf0
2 changed files with 4 additions and 6 deletions
@@ -29,14 +29,12 @@ class WarehouseSupplierClientContractTest {
}
@Test
void openApiDocumentsServerResolvedSupplierSnapshots() throws Exception {
void oceanAndTruckOpenApisDocumentServerResolvedSupplierSnapshots() throws Exception {
String ocean = Files.readString(Path.of("src/main/resources/openapi/ocean-bookings-v1.yaml"), StandardCharsets.UTF_8);
String truck = Files.readString(Path.of("src/main/resources/openapi/truck-appointments-v1.yaml"), StandardCharsets.UTF_8);
String customs = Files.readString(Path.of("src/main/resources/openapi/customs-v1.yaml"), StandardCharsets.UTF_8);
assertThat(ocean).contains("bookingAgentId:", "category BOOKING",
"do not use domestic/international scope", "persisted snapshot always comes from Warehouse")
.doesNotContain("BOOKING with INTERNATIONAL scope");
assertThat(truck).contains("carrierId:", "TRUCKING", "persisted snapshot comes from Warehouse");
assertThat(customs).contains("customsAgentId", "CUSTOMS", "free text cannot bypass supplier validation");
}
}
@@ -89,9 +89,9 @@ class OutboundDispatchReadMapperContractTest {
assertThat(sql)
.contains("SELECT 'CUSTOMS'", "FROM fl_customs_container_history h JOIN fl_customs_container customs_container")
.contains("customs_case.tenant_id=#{tenantId}", "customs_case.order_id=#{orderId}")
.contains("customs_case.inbound_id=#{inboundId}",
"customs_case.container_booking_id=#{containerBookingId}")
.contains("customs_container.container_booking_id=#{containerBookingId}")
.doesNotContain("fl_customs_history", "customs_case.tenant_id=#{tenantId}",
"customs_case.order_id=#{orderId}", "customs_case.inbound_id=#{inboundId}")
.contains("SELECT 'SAILING_SCHEDULE'",
"FROM fl_port_schedule_history h JOIN fl_port_schedule port_schedule")
.contains("port_schedule.customer_id=#{tenantId}",