23 lines
973 B
Java
23 lines
973 B
Java
package com.baiyue.lastleg.discard;
|
|||
|
|
|
||
|
|
import org.junit.jupiter.api.Test;
|
||
|
|
|
||
|
|
import java.nio.charset.StandardCharsets;
|
||
|
|
|
||
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||
|
|
|
||
|
|
class CargoDiscardSchemaContractTest {
|
||
|
|
@Test
|
||
|
|
void baselineContainsDiscardApplicationReservationAndHistoryTables() throws Exception {
|
||
|
|
String sql;
|
||
|
|
try (var input = getClass().getResourceAsStream("/db/lastleg.sql")) {
|
||
|
|
sql = new String(input.readAllBytes(), StandardCharsets.UTF_8);
|
||
|
|
}
|
||
|
|
assertTrue(sql.contains("CREATE TABLE IF NOT EXISTS ll_cargo_discard_application"));
|
||
|
|
assertTrue(sql.contains("CREATE TABLE IF NOT EXISTS ll_cargo_discard_item"));
|
||
|
|
assertTrue(sql.contains("CREATE TABLE IF NOT EXISTS ll_cargo_discard_carton"));
|
||
|
|
assertTrue(sql.contains("CREATE TABLE IF NOT EXISTS ll_cargo_discard_status_history"));
|
||
|
|
assertTrue(sql.contains("UNIQUE KEY uk_ll_cargo_discard_carton(application_id,carton_id)"));
|
||
|
|
}
|
||
|
|
}
|