package com.ruoyi.config; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.InputStream; import java.nio.charset.StandardCharsets; import org.junit.jupiter.api.Test; /** V29 补删 Ticket28 遗漏的历史补采游标和数据缺口表。 */ class Ticket29MigrationContractTest { @Test void removesRemainingHistorySyncTables() { String sql = resource("db/migration/V29__remove_remaining_history_gap_legacy.sql"); assertTrue(sql.contains("DROP TABLE IF EXISTS t_data_gap")); assertTrue(sql.contains("DROP TABLE IF EXISTS t_history_sync_cursor")); } private static String resource(String path) { try (InputStream stream = Ticket29MigrationContractTest.class.getClassLoader().getResourceAsStream(path)) { if (stream == null) throw new AssertionError("Missing migration resource " + path); return new String(stream.readAllBytes(), StandardCharsets.UTF_8); } catch (Exception exception) { throw new AssertionError("Unable to read migration resource " + path, exception); } } }