Skip to content

Commit 6d8e8d3

Browse files
author
raju.gupta
committed
Refactor query execution methods to use executeSelectOneQuery and executeQuery for consistency
1 parent 6079f9d commit 6d8e8d3

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

modules/cockroachdb/src/test/java/org/testcontainers/cockroachdb/CockroachContainerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void testExplicitInitScript() throws SQLException {
3737
) { // CockroachDB is expected to be compatible with Postgres
3838
cockroach.start();
3939

40-
performSelectFooBarQuery(cockroach);
40+
executeSelectFooBarQuery(cockroach);
4141
}
4242
}
4343

@@ -112,7 +112,7 @@ void testInitializationScript() throws SQLException {
112112
) { // CockroachDB is expected to be compatible with Postgres
113113
cockroach.start();
114114

115-
performSelectFooBarQuery(cockroach);
115+
executeSelectFooBarQuery(cockroach);
116116
}
117117
}
118118
}

modules/cratedb/src/test/java/org/testcontainers/junit/cratedb/SimpleCrateDBTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void testExplicitInitScript() throws SQLException {
6262
) {
6363
cratedb.start();
6464

65-
performSelectFooBarQuery(cratedb);
65+
executeSelectFooBarQuery(cratedb);
6666
}
6767
}
6868

modules/jdbc-test/src/main/java/org/testcontainers/db/AbstractContainerDatabaseTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected void executeSelectOneQuery(final JdbcDatabaseContainer<?> container, f
5252
);
5353
}
5454

55-
protected void performSelectFooBarQuery(final JdbcDatabaseContainer<?> container) throws SQLException {
55+
protected void executeSelectFooBarQuery(final JdbcDatabaseContainer<?> container) throws SQLException {
5656
executeQuery(
5757
container,
5858
"SELECT foo FROM bar",
@@ -70,7 +70,7 @@ protected void performSelectFooBarQuery(final JdbcDatabaseContainer<?> container
7070
);
7171
}
7272

73-
protected void performSelectMaxConnectionsQuery(
73+
protected void executeSelectMaxConnectionsQuery(
7474
final JdbcDatabaseContainer<?> container,
7575
final String expectedMaxConnections
7676
) throws SQLException {
@@ -91,7 +91,7 @@ protected void performSelectMaxConnectionsQuery(
9191
);
9292
}
9393

94-
protected void performSelectVersionQuery(final JdbcDatabaseContainer<?> container, final String expectedVersion)
94+
protected void executeSelectVersionQuery(final JdbcDatabaseContainer<?> container, final String expectedVersion)
9595
throws SQLException {
9696
executeQuery(
9797
container,

modules/mysql/src/test/java/org/testcontainers/mysql/MultiVersionMySQLTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static DockerImageName[] params() {
2424
void versionCheckTest(DockerImageName dockerImageName) throws SQLException {
2525
try (MySQLContainer mysql = new MySQLContainer(dockerImageName)) {
2626
mysql.start();
27-
performSelectVersionQuery(mysql, dockerImageName.getVersionPart());
27+
executeSelectVersionQuery(mysql, dockerImageName.getVersionPart());
2828
}
2929
}
3030
}

modules/mysql/src/test/java/org/testcontainers/mysql/MySQLContainerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void testSpecificVersion() throws SQLException {
5757
) {
5858
mysqlOldVersion.start();
5959

60-
performSelectVersionQuery(mysqlOldVersion, "8.0.36");
60+
executeSelectVersionQuery(mysqlOldVersion, "8.0.36");
6161
}
6262
}
6363

@@ -107,7 +107,7 @@ void testExplicitInitScript() throws SQLException {
107107
) {
108108
container.start();
109109

110-
performSelectFooBarQuery(container);
110+
executeSelectFooBarQuery(container);
111111
}
112112
}
113113

modules/oceanbase/src/test/java/org/testcontainers/oceanbase/SimpleOceanBaseCETest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void testExplicitInitScript() throws SQLException {
3232
try (OceanBaseCEContainer oceanbase = new OceanBaseCEContainer(IMAGE).withInitScript("init.sql")) {
3333
oceanbase.start();
3434

35-
performSelectFooBarQuery(oceanbase);
35+
executeSelectFooBarQuery(oceanbase);
3636
}
3737
}
3838

modules/postgresql/src/test/java/org/testcontainers/containers/TimescaleDBContainerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void testCommandOverride() throws SQLException {
2525
) {
2626
postgres.start();
2727

28-
performSelectMaxConnectionsQuery((JdbcDatabaseContainer<?>) postgres, "42");
28+
executeSelectMaxConnectionsQuery((JdbcDatabaseContainer<?>) postgres, "42");
2929
}
3030
}
3131

@@ -39,7 +39,7 @@ void testUnsetCommand() throws SQLException {
3939
) {
4040
postgres.start();
4141

42-
performSelectMaxConnectionsQuery((JdbcDatabaseContainer<?>) postgres, "100");
42+
executeSelectMaxConnectionsQuery((JdbcDatabaseContainer<?>) postgres, "100");
4343
}
4444
}
4545

@@ -52,7 +52,7 @@ void testExplicitInitScript() throws SQLException {
5252
) {
5353
postgres.start();
5454

55-
performSelectFooBarQuery(postgres);
55+
executeSelectFooBarQuery(postgres);
5656
}
5757
}
5858
}

modules/postgresql/src/test/java/org/testcontainers/postgresql/PostgreSQLContainerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void testCommandOverride() throws SQLException {
4040
) {
4141
postgres.start();
4242

43-
performSelectMaxConnectionsQuery(postgres, "42");
43+
executeSelectMaxConnectionsQuery(postgres, "42");
4444
}
4545
}
4646

@@ -55,7 +55,7 @@ void testUnsetCommand() throws SQLException {
5555

5656
// After unsetting the command, max_connections should be the default value (100), not 42
5757

58-
performSelectMaxConnectionsQuery(postgres, "100");
58+
executeSelectMaxConnectionsQuery(postgres, "100");
5959
}
6060
}
6161

@@ -77,7 +77,7 @@ void testExplicitInitScript() throws SQLException {
7777
) {
7878
postgres.start();
7979

80-
performSelectFooBarQuery(postgres);
80+
executeSelectFooBarQuery(postgres);
8181
}
8282
}
8383

modules/tidb/src/test/java/org/testcontainers/tidb/TiDBContainerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void testExplicitInitScript() throws SQLException {
3131
) { // TiDB is expected to be compatible with MySQL
3232
tidb.start();
3333

34-
performSelectFooBarQuery(tidb);
34+
executeSelectFooBarQuery(tidb);
3535
}
3636
}
3737

0 commit comments

Comments
 (0)