Skip to content

Commit

Permalink
DBZ-7858 Align NotificationsIT test to core changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mfvitale authored and jpechane committed May 14, 2024
1 parent 69dd590 commit 80c1731
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/test/java/io/debezium/connector/db2/NotificationsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,9 +23,19 @@ public class NotificationsIT extends AbstractNotificationsIT<Db2Connector> {

@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();
Expand All @@ -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();
}
}
Expand Down Expand Up @@ -64,4 +80,8 @@ protected String server() {
protected String snapshotStatusResult() {
return "COMPLETED";
}

protected List<String> collections() {
return List.of("DB2INST1.TABLEA");
}
}

0 comments on commit 80c1731

Please sign in to comment.