Skip to content

Commit

Permalink
Use MySQLContainer for Debezium Testcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
artembilan committed Jun 15, 2023
1 parent 99122d7 commit 656281e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -589,6 +589,7 @@ project('spring-integration-debezium') {
}

testImplementation "io.debezium:debezium-connector-mysql:$debeziumVersion"
testImplementation 'org.testcontainers:mysql'
}
}

Expand Down
Expand Up @@ -20,9 +20,9 @@
import java.util.UUID;

import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

/**
* @author Christian Tzolov
Expand All @@ -35,13 +35,12 @@ public interface DebeziumMySqlTestContainer {

int EXPECTED_DB_TX_COUNT = 52;

GenericContainer<?> DEBEZIUM_MYSQL =
new GenericContainer<>("debezium/example-mysql:2.2.0.Final")
.withExposedPorts(3306)
.withEnv("MYSQL_ROOT_PASSWORD", "debezium")
.withEnv("MYSQL_USER", "mysqluser")
.withEnv("MYSQL_PASSWORD", "mysqlpw")
.waitingFor(new LogMessageWaitStrategy().withRegEx(".*port: 3306 MySQL Community Server - GPL.*."));
MySQLContainer<?> DEBEZIUM_MYSQL =
new MySQLContainer<>(
DockerImageName.parse("debezium/example-mysql:2.2.0.Final")
.asCompatibleSubstituteFor("mysql"))
.withUsername("mysqluser")
.withPassword("mysqlpw");

@BeforeAll
static void startContainer() {
Expand Down

0 comments on commit 656281e

Please sign in to comment.