Skip to content

Commit a086b6f

Browse files
committed
Move YugabyteDB tests to JUnit Jupiter
1 parent db2ab64 commit a086b6f

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

modules/yugabytedb/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@ description = "Testcontainers :: JDBC :: YugabyteDB"
22

33
dependencies {
44
api project(':testcontainers-jdbc')
5+
6+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
7+
8+
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
59
testImplementation project(':testcontainers-jdbc-test')
610
// YCQL driver
711
testImplementation 'com.yugabyte:java-driver-core:4.19.0-yb-1'
812
// YSQL driver
913
testRuntimeOnly 'com.yugabyte:jdbc-yugabytedb:42.7.3-yb-4'
1014
}
15+
16+
test {
17+
useJUnitPlatform()
18+
}

modules/yugabytedb/src/test/java/org/testcontainers/jdbc/yugabytedb/YugabyteDBYSQLJDBCDriverTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.testcontainers.jdbc.yugabytedb;
22

3-
import org.junit.runner.RunWith;
4-
import org.junit.runners.Parameterized;
53
import org.testcontainers.jdbc.AbstractJDBCDriverTest;
64

75
import java.util.Arrays;
@@ -10,10 +8,8 @@
108
/**
119
* YugabyteDB YSQL API JDBC connectivity driver test class
1210
*/
13-
@RunWith(Parameterized.class)
14-
public class YugabyteDBYSQLJDBCDriverTest extends AbstractJDBCDriverTest {
11+
class YugabyteDBYSQLJDBCDriverTest extends AbstractJDBCDriverTest {
1512

16-
@Parameterized.Parameters(name = "{index} - {0}")
1713
public static Iterable<Object[]> data() {
1814
return Arrays.asList(
1915
new Object[][] {

modules/yugabytedb/src/test/java/org/testcontainers/junit/yugabytedb/YugabyteDBYCQLTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.datastax.oss.driver.api.core.CqlSession;
44
import com.datastax.oss.driver.api.core.cql.ResultSet;
5-
import org.junit.Test;
5+
import org.junit.jupiter.api.Test;
66
import org.testcontainers.containers.YugabyteDBYCQLContainer;
77
import org.testcontainers.utility.DockerImageName;
88

@@ -11,7 +11,7 @@
1111
/**
1212
* YugabyteDB YCQL API unit test class
1313
*/
14-
public class YugabyteDBYCQLTest {
14+
class YugabyteDBYCQLTest {
1515

1616
private static final String IMAGE_NAME = "yugabytedb/yugabyte:2.14.4.0-b26";
1717

@@ -20,7 +20,7 @@ public class YugabyteDBYCQLTest {
2020
private static final DockerImageName YBDB_TEST_IMAGE = DockerImageName.parse(IMAGE_NAME);
2121

2222
@Test
23-
public void testSmoke() {
23+
void testSmoke() {
2424
try (
2525
// creatingYCQLContainer {
2626
final YugabyteDBYCQLContainer ycqlContainer = new YugabyteDBYCQLContainer(
@@ -38,7 +38,7 @@ public void testSmoke() {
3838
}
3939

4040
@Test
41-
public void testCustomKeyspace() {
41+
void testCustomKeyspace() {
4242
String key = "random";
4343
try (
4444
final YugabyteDBYCQLContainer ycqlContainer = new YugabyteDBYCQLContainer(YBDB_TEST_IMAGE)
@@ -61,7 +61,7 @@ public void testCustomKeyspace() {
6161
}
6262

6363
@Test
64-
public void testAuthenticationEnabled() {
64+
void testAuthenticationEnabled() {
6565
String role = "random";
6666
try (
6767
final YugabyteDBYCQLContainer ycqlContainer = new YugabyteDBYCQLContainer(YBDB_TEST_IMAGE)
@@ -80,7 +80,7 @@ public void testAuthenticationEnabled() {
8080
}
8181

8282
@Test
83-
public void testAuthenticationDisabled() {
83+
void testAuthenticationDisabled() {
8484
try (
8585
final YugabyteDBYCQLContainer ycqlContainer = new YugabyteDBYCQLContainer(YBDB_TEST_IMAGE)
8686
.withPassword("cassandra")
@@ -94,7 +94,7 @@ public void testAuthenticationDisabled() {
9494
}
9595

9696
@Test
97-
public void testInitScript() {
97+
void testInitScript() {
9898
String key = "random";
9999
try (
100100
final YugabyteDBYCQLContainer ycqlContainer = new YugabyteDBYCQLContainer(YBDB_TEST_IMAGE)
@@ -111,7 +111,7 @@ public void testInitScript() {
111111
}
112112

113113
@Test
114-
public void shouldStartWhenContainerIpIsUsedInWaitStrategy() {
114+
void shouldStartWhenContainerIpIsUsedInWaitStrategy() {
115115
try (
116116
final YugabyteDBYCQLContainer ycqlContainer = new YugabyteDBYCQLContainer(IMAGE_NAME_2_18)
117117
.withUsername("cassandra")

modules/yugabytedb/src/test/java/org/testcontainers/junit/yugabytedb/YugabyteDBYSQLTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.testcontainers.junit.yugabytedb;
22

3-
import org.junit.Test;
3+
import org.junit.jupiter.api.Test;
44
import org.testcontainers.containers.YugabyteDBYSQLContainer;
55
import org.testcontainers.db.AbstractContainerDatabaseTest;
66
import org.testcontainers.utility.DockerImageName;
@@ -12,14 +12,14 @@
1212
/**
1313
* YugabyteDB YSQL API unit test class
1414
*/
15-
public class YugabyteDBYSQLTest extends AbstractContainerDatabaseTest {
15+
class YugabyteDBYSQLTest extends AbstractContainerDatabaseTest {
1616

1717
private static final String IMAGE_NAME = "yugabytedb/yugabyte:2.14.4.0-b26";
1818

1919
private static final DockerImageName YBDB_TEST_IMAGE = DockerImageName.parse(IMAGE_NAME);
2020

2121
@Test
22-
public void testSmoke() throws SQLException {
22+
void testSmoke() throws SQLException {
2323
try (
2424
// creatingYSQLContainer {
2525
final YugabyteDBYSQLContainer ysqlContainer = new YugabyteDBYSQLContainer(
@@ -35,7 +35,7 @@ public void testSmoke() throws SQLException {
3535
}
3636

3737
@Test
38-
public void testCustomDatabase() throws SQLException {
38+
void testCustomDatabase() throws SQLException {
3939
String key = "random";
4040
try (
4141
final YugabyteDBYSQLContainer ysqlContainer = new YugabyteDBYSQLContainer(YBDB_TEST_IMAGE)
@@ -49,7 +49,7 @@ public void testCustomDatabase() throws SQLException {
4949
}
5050

5151
@Test
52-
public void testInitScript() throws SQLException {
52+
void testInitScript() throws SQLException {
5353
try (
5454
final YugabyteDBYSQLContainer ysqlContainer = new YugabyteDBYSQLContainer(YBDB_TEST_IMAGE)
5555
.withInitScript("init/init_yql.sql")
@@ -62,7 +62,7 @@ public void testInitScript() throws SQLException {
6262
}
6363

6464
@Test
65-
public void testWithAdditionalUrlParamInJdbcUrl() {
65+
void testWithAdditionalUrlParamInJdbcUrl() {
6666
try (
6767
final YugabyteDBYSQLContainer ysqlContainer = new YugabyteDBYSQLContainer(YBDB_TEST_IMAGE)
6868
.withUrlParam("sslmode", "disable")
@@ -80,7 +80,7 @@ public void testWithAdditionalUrlParamInJdbcUrl() {
8080
}
8181

8282
@Test
83-
public void testWithCustomRole() throws SQLException {
83+
void testWithCustomRole() throws SQLException {
8484
try (
8585
final YugabyteDBYSQLContainer ysqlContainer = new YugabyteDBYSQLContainer(YBDB_TEST_IMAGE)
8686
.withDatabaseName("yugabyte")
@@ -95,7 +95,7 @@ public void testWithCustomRole() throws SQLException {
9595
}
9696

9797
@Test
98-
public void testWaitStrategy() throws SQLException {
98+
void testWaitStrategy() throws SQLException {
9999
try (final YugabyteDBYSQLContainer ysqlContainer = new YugabyteDBYSQLContainer(YBDB_TEST_IMAGE)) {
100100
ysqlContainer.start();
101101
assertThat(performQuery(ysqlContainer, "SELECT 1").getInt(1))

0 commit comments

Comments
 (0)