yeg
2026-09-05 90882aca0b60a5b39e127d30438752a774b3a7ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.battery.business.runtime;
 
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);
        }
    }
}