Skip to content

Commit 32536ad

Browse files
authored
Move Couchbase tests to JUnit Jupiter (#10734)
1 parent 7836f16 commit 32536ad

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

modules/couchbase/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ dependencies {
55
// TODO use JDK's HTTP client and/or Apache HttpClient5
66
shaded 'com.squareup.okhttp3:okhttp:5.1.0'
77

8+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.11.0'
9+
10+
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.4'
811
testImplementation 'com.couchbase.client:java-client:3.9.0'
912
testImplementation 'org.awaitility:awaitility:4.3.0'
1013
testImplementation 'org.assertj:assertj-core:3.27.4'
@@ -15,3 +18,7 @@ tasks.japicmp {
1518
"org.testcontainers.couchbase.CouchbaseContainer"
1619
]
1720
}
21+
22+
test {
23+
useJUnitPlatform()
24+
}

modules/couchbase/src/test/java/org/testcontainers/couchbase/CouchbaseContainerTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import com.couchbase.client.java.Cluster;
2121
import com.couchbase.client.java.Collection;
2222
import com.couchbase.client.java.json.JsonObject;
23-
import org.junit.Test;
23+
import org.junit.jupiter.api.Test;
2424
import org.testcontainers.containers.ContainerLaunchException;
2525

2626
import java.time.Duration;
@@ -30,7 +30,7 @@
3030
import static org.assertj.core.api.Assertions.assertThatThrownBy;
3131
import static org.awaitility.Awaitility.await;
3232

33-
public class CouchbaseContainerTest {
33+
class CouchbaseContainerTest {
3434

3535
private static final String COUCHBASE_IMAGE_ENTERPRISE = "couchbase/server:enterprise-7.0.3";
3636

@@ -41,22 +41,22 @@ public class CouchbaseContainerTest {
4141
private static final String COUCHBASE_IMAGE_COMMUNITY_RECENT = "couchbase/server:community-7.6.2";
4242

4343
@Test
44-
public void testBasicContainerUsageForEnterpriseContainer() {
44+
void testBasicContainerUsageForEnterpriseContainer() {
4545
testBasicContainerUsage(COUCHBASE_IMAGE_ENTERPRISE);
4646
}
4747

4848
@Test
49-
public void testBasicContainerUsageForEnterpriseContainerRecent() {
49+
void testBasicContainerUsageForEnterpriseContainerRecent() {
5050
testBasicContainerUsage(COUCHBASE_IMAGE_ENTERPRISE_RECENT);
5151
}
5252

5353
@Test
54-
public void testBasicContainerUsageForCommunityContainer() {
54+
void testBasicContainerUsageForCommunityContainer() {
5555
testBasicContainerUsage(COUCHBASE_IMAGE_COMMUNITY);
5656
}
5757

5858
@Test
59-
public void testBasicContainerUsageForCommunityContainerRecent() {
59+
void testBasicContainerUsageForCommunityContainerRecent() {
6060
testBasicContainerUsage(COUCHBASE_IMAGE_COMMUNITY_RECENT);
6161
}
6262

@@ -89,7 +89,7 @@ private void testBasicContainerUsage(String couchbaseImage) {
8989
}
9090

9191
@Test
92-
public void testBucketIsFlushableIfEnabled() {
92+
void testBucketIsFlushableIfEnabled() {
9393
BucketDefinition bucketDefinition = new BucketDefinition("mybucket").withFlushEnabled(true);
9494

9595
try (
@@ -119,7 +119,7 @@ public void testBucketIsFlushableIfEnabled() {
119119
* edition which is not supported.
120120
*/
121121
@Test
122-
public void testFailureIfCommunityUsedWithAnalytics() {
122+
void testFailureIfCommunityUsedWithAnalytics() {
123123
try (
124124
CouchbaseContainer container = new CouchbaseContainer(COUCHBASE_IMAGE_COMMUNITY)
125125
.withEnabledServices(CouchbaseService.KV, CouchbaseService.ANALYTICS)
@@ -136,7 +136,7 @@ public void testFailureIfCommunityUsedWithAnalytics() {
136136
* edition which is not supported.
137137
*/
138138
@Test
139-
public void testFailureIfCommunityUsedWithEventing() {
139+
void testFailureIfCommunityUsedWithEventing() {
140140
try (
141141
CouchbaseContainer container = new CouchbaseContainer(COUCHBASE_IMAGE_COMMUNITY)
142142
.withEnabledServices(CouchbaseService.KV, CouchbaseService.EVENTING)

0 commit comments

Comments
 (0)