diff --git a/src/test/java/io/debezium/connector/db2/NotificationsIT.java b/src/test/java/io/debezium/connector/db2/NotificationsIT.java index f106781..1060694 100644 --- a/src/test/java/io/debezium/connector/db2/NotificationsIT.java +++ b/src/test/java/io/debezium/connector/db2/NotificationsIT.java @@ -7,6 +7,7 @@ package io.debezium.connector.db2; import java.sql.SQLException; +import java.util.List; import org.junit.After; import org.junit.Before; @@ -22,9 +23,19 @@ public class NotificationsIT extends AbstractNotificationsIT { @Before public void before() throws SQLException { - + TestHelper.dropAllTables(); connection = TestHelper.testConnection(); + connection.execute("DELETE FROM ASNCDC.IBMSNAP_REGISTER"); + connection.execute( + "CREATE TABLE tablea (id int not null, cola varchar(30), primary key (id))", + "INSERT INTO tablea VALUES(1, 'a')"); + + TestHelper.enableTableCdc(connection, "TABLEA"); + TestHelper.enableDbCdc(connection); + connection.execute("UPDATE ASNCDC.IBMSNAP_REGISTER SET STATE = 'A' WHERE SOURCE_OWNER = 'DB2INST1'"); + TestHelper.refreshAndWait(connection); + initializeConnectorTestFramework(); Testing.Files.delete(TestHelper.DB_HISTORY_PATH); Testing.Print.enable(); @@ -35,6 +46,11 @@ public void after() throws SQLException { if (connection != null) { TestHelper.disableDbCdc(connection); + TestHelper.disableTableCdc(connection, "TABLEA"); + connection.execute("DROP TABLE tablea"); + connection.execute("DELETE FROM ASNCDC.IBMSNAP_REGISTER"); + connection.execute("DELETE FROM ASNCDC.IBMQREP_COLVERSION"); + connection.execute("DELETE FROM ASNCDC.IBMQREP_TABVERSION"); connection.close(); } } @@ -64,4 +80,8 @@ protected String server() { protected String snapshotStatusResult() { return "COMPLETED"; } + + protected List collections() { + return List.of("DB2INST1.TABLEA"); + } }