Skip to content

Commit 8e07d8c

Browse files
committed
Move DB2 tests to JUnit Jupiter
1 parent 2eee1be commit 8e07d8c

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

modules/db2/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ description = "Testcontainers :: JDBC :: DB2"
33
dependencies {
44
api project(':testcontainers-jdbc')
55

6+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
7+
8+
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
69
testImplementation project(':testcontainers-jdbc-test')
710
testRuntimeOnly 'com.ibm.db2:jcc:12.1.2.0'
811
testImplementation 'org.assertj:assertj-core:3.27.4'
@@ -13,3 +16,7 @@ tasks.japicmp {
1316
"org.testcontainers.containers.Db2Container"
1417
]
1518
}
19+
20+
test {
21+
useJUnitPlatform()
22+
}

modules/db2/src/test/java/org/testcontainers/jdbc/db2/DB2JDBCDriverTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
package org.testcontainers.jdbc.db2;
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;
86
import java.util.EnumSet;
97

10-
@RunWith(Parameterized.class)
11-
public class DB2JDBCDriverTest extends AbstractJDBCDriverTest {
8+
class DB2JDBCDriverTest extends AbstractJDBCDriverTest {
129

13-
@Parameterized.Parameters(name = "{index} - {0}")
1410
public static Iterable<Object[]> data() {
1511
return Arrays.asList(
1612
new Object[][] { //

modules/db2/src/test/java/org/testcontainers/junit/db2/SimpleDb2Test.java

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

3-
import org.junit.Test;
3+
import org.junit.jupiter.api.Test;
44
import org.testcontainers.Db2TestImages;
55
import org.testcontainers.containers.Db2Container;
66
import org.testcontainers.db.AbstractContainerDatabaseTest;
@@ -10,10 +10,10 @@
1010

1111
import static org.assertj.core.api.Assertions.assertThat;
1212

13-
public class SimpleDb2Test extends AbstractContainerDatabaseTest {
13+
class SimpleDb2Test extends AbstractContainerDatabaseTest {
1414

1515
@Test
16-
public void testSimple() throws SQLException {
16+
void testSimple() throws SQLException {
1717
try ( // container {
1818
Db2Container db2 = new Db2Container("ibmcom/db2:11.5.0.0a").acceptLicense()
1919
// }
@@ -29,7 +29,7 @@ public void testSimple() throws SQLException {
2929
}
3030

3131
@Test
32-
public void testSimpleWithNewImage() throws SQLException {
32+
void testSimpleWithNewImage() throws SQLException {
3333
try (Db2Container db2 = new Db2Container("icr.io/db2_community/db2:11.5.8.0").acceptLicense()) {
3434
db2.start();
3535

@@ -42,7 +42,7 @@ public void testSimpleWithNewImage() throws SQLException {
4242
}
4343

4444
@Test
45-
public void testWithAdditionalUrlParamInJdbcUrl() {
45+
void testWithAdditionalUrlParamInJdbcUrl() {
4646
try (
4747
Db2Container db2 = new Db2Container(Db2TestImages.DB2_IMAGE)
4848
.withUrlParam("sslConnection", "false")

0 commit comments

Comments
 (0)