11package org .sterl .spring .persistent_tasks .db ;
22
3- import java .util .List ;
3+ import static org .assertj .core .api .Assertions .assertThat ;
4+
45import java .util .Map ;
56
67import javax .sql .DataSource ;
@@ -19,7 +20,7 @@ class ApplyLiquibaseTest {
1920
2021 @ Test
2122 void test () throws Exception {
22- var dataSource = mssqlDb ();
23+ var dataSource = h2Db ();
2324 try (Database database = DatabaseFactory .getInstance ()
2425 .findCorrectDatabaseImplementation (
2526 new liquibase .database .jvm .JdbcConnection (dataSource .getConnection ()))) {
@@ -40,10 +41,28 @@ void test() throws Exception {
4041 }
4142
4243 var template = new JdbcTemplate (dataSource );
43- final List < Map < String , Object >> var = template .queryForList ("SHOW TABLES" );
44- for (Map <String , Object > map : var ) {
44+ final var tables = template .queryForList ("SHOW TABLES" );
45+ for (Map <String , Object > map : tables ) {
4546 System .err .println (map );
4647 }
48+ assertThat (tables ).contains (
49+ Map .of ("TABLE_NAME" , "PT_DATABASECHANGELOG" ,
50+ "TABLE_SCHEMA" , "PUBLIC" ));
51+ assertThat (tables ).contains (
52+ Map .of ("TABLE_NAME" , "PT_DATABASECHANGELOGLOCK" ,
53+ "TABLE_SCHEMA" , "PUBLIC" ));
54+ assertThat (tables ).contains (
55+ Map .of ("TABLE_NAME" , "PT_SCHEDULER" ,
56+ "TABLE_SCHEMA" , "PUBLIC" ));
57+ assertThat (tables ).contains (
58+ Map .of ("TABLE_NAME" , "PT_TASK_TRIGGERS" ,
59+ "TABLE_SCHEMA" , "PUBLIC" ));
60+ assertThat (tables ).contains (
61+ Map .of ("TABLE_NAME" , "PT_TRIGGER_HISTORY_DETAILS" ,
62+ "TABLE_SCHEMA" , "PUBLIC" ));
63+ assertThat (tables ).contains (
64+ Map .of ("TABLE_NAME" , "PT_TRIGGER_HISTORY_LAST_STATES" ,
65+ "TABLE_SCHEMA" , "PUBLIC" ));
4766 }
4867
4968 private JdbcDataSource h2Db () {
0 commit comments