From 07603045d58ecd36f6ebfdec70c6f5f46672847c Mon Sep 17 00:00:00 2001 From: Jiri Pechanec Date: Mon, 27 Nov 2023 07:59:28 +0100 Subject: [PATCH] DBZ-7179 Use new MySQL adapter --- .../debezium/server/redis/RedisSchemaHistoryIT.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/debezium-server-redis/src/test/java/io/debezium/server/redis/RedisSchemaHistoryIT.java b/debezium-server-redis/src/test/java/io/debezium/server/redis/RedisSchemaHistoryIT.java index 7046972d..ab082661 100644 --- a/debezium-server-redis/src/test/java/io/debezium/server/redis/RedisSchemaHistoryIT.java +++ b/debezium-server-redis/src/test/java/io/debezium/server/redis/RedisSchemaHistoryIT.java @@ -15,8 +15,8 @@ import org.junitpioneer.jupiter.RetryingTest; import io.debezium.config.Configuration; -import io.debezium.connector.mysql.MySqlConnection; -import io.debezium.connector.mysql.MySqlConnection.MySqlConnectionConfiguration; +import io.debezium.connector.mysql.MySqlConnectorConfig; +import io.debezium.connector.mysql.strategy.AbstractConnectorConnection; import io.debezium.doc.FixFor; import io.debezium.relational.history.AbstractSchemaHistoryTest; import io.debezium.relational.history.SchemaHistory; @@ -100,7 +100,7 @@ public void testRedisConnectionRetry() throws Exception { Testing.print("Pausing container"); RedisTestResourceLifecycleManager.pause(); - final MySqlConnection connection = getMySqlConnection(); + final AbstractConnectorConnection connection = getMySqlConnection(); connection.connect(); Testing.print("Creating new redis_test table and inserting 5 records to it"); connection.execute("CREATE TABLE inventory.redis_test (id INT PRIMARY KEY)"); @@ -120,13 +120,14 @@ public void testRedisConnectionRetry() throws Exception { assertTrue(entries.get(INIT_HISTORY_SIZE).getFields().get("schema").contains("redis_test")); } - private MySqlConnection getMySqlConnection() { - return new MySqlConnection(new MySqlConnectionConfiguration(Configuration.create() + private AbstractConnectorConnection getMySqlConnection() { + final Configuration config = Configuration.create() .with("database.user", MySqlTestResourceLifecycleManager.PRIVILEGED_USER) .with("database.password", MySqlTestResourceLifecycleManager.PRIVILEGED_PASSWORD) .with("database.dbname", MySqlTestResourceLifecycleManager.DBNAME) .with("database.hostname", MySqlTestResourceLifecycleManager.HOST) .with("database.port", MySqlTestResourceLifecycleManager.getContainer().getMappedPort(MySqlTestResourceLifecycleManager.PORT)) - .build())); + .build(); + return new MySqlConnectorConfig(config).getConnectorAdapter().createConnection(config); } }