Skip to content

Commit

Permalink
[FLINK-36945] Tweak to make static final field SCREAMING_CASE
Browse files Browse the repository at this point in the history
  • Loading branch information
yoheimuta committed Feb 7, 2025
1 parent a29d93b commit e9c3263
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
import org.apache.flink.util.FlinkRuntimeException;

import io.debezium.connector.mysql.MySqlConnection;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand Down Expand Up @@ -80,7 +82,7 @@ public class MySqlMultipleTablesRenamingITCase {
@RegisterExtension static MiniClusterExtension miniCluster = new MiniClusterExtension();

@SuppressWarnings("unchecked")
private static final MySqlContainer mysql =
private static final MySqlContainer MYSQL =
(MySqlContainer)
new MySqlContainer()
.withConfigurationOverride(
Expand All @@ -93,15 +95,24 @@ public class MySqlMultipleTablesRenamingITCase {
.withLogConsumer(new Slf4jLogConsumer(LOG));

private final UniqueDatabase customDatabase =
new UniqueDatabase(mysql, "customer", "mysqluser", "mysqlpw");
new UniqueDatabase(MYSQL, "customer", "mysqluser", "mysqlpw");
private final TestTable customers =
new TestTable(customDatabase, "customers", TestTableSchemas.CUSTOMERS);

private MySqlConnection connection;

@BeforeAll
public static void before() throws Exception {
MYSQL.start();
}

@AfterAll
public static void after() throws Exception {
MYSQL.stop();
}

@BeforeEach
void prepare() throws Exception {
mysql.start();
connection = getConnection();
customDatabase.createAndInitialize();
flushLogs();
Expand All @@ -111,7 +122,6 @@ void prepare() throws Exception {
void tearDown() throws Exception {
customDatabase.dropDatabase();
connection.close();
mysql.stop();
}

/**
Expand Down Expand Up @@ -253,8 +263,8 @@ void testRenameTablesWithinSingleStatement() throws Exception {

private MySqlSourceBuilder<String> getSourceBuilder() {
return MySqlSource.<String>builder()
.hostname(mysql.getHost())
.port(mysql.getDatabasePort())
.hostname(MYSQL.getHost())
.port(MYSQL.getDatabasePort())
.username(customDatabase.getUsername())
.password(customDatabase.getPassword())
.databaseList(customDatabase.getDatabaseName())
Expand All @@ -264,8 +274,8 @@ private MySqlSourceBuilder<String> getSourceBuilder() {

private MySqlConnection getConnection() {
Map<String, String> properties = new HashMap<>();
properties.put("database.hostname", mysql.getHost());
properties.put("database.port", String.valueOf(mysql.getDatabasePort()));
properties.put("database.hostname", MYSQL.getHost());
properties.put("database.port", String.valueOf(MYSQL.getDatabasePort()));
properties.put("database.user", customDatabase.getUsername());
properties.put("database.password", customDatabase.getPassword());
io.debezium.config.Configuration configuration =
Expand Down

0 comments on commit e9c3263

Please sign in to comment.