This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-connectors.git


The following commit(s) were added to refs/heads/main by this push:
     new e0927d9a9 switch to junit5 to try to fix tests (#1311)
e0927d9a9 is described below

commit e0927d9a9a638ab2cc1bf3f63a9cd520abb45fbb
Author: PJ Fanning <[email protected]>
AuthorDate: Thu Dec 4 09:21:40 2025 +0100

    switch to junit5 to try to fix tests (#1311)
    
    * switch to junit5 to try to fix tests
    
    * Update S3Test.java
    
    * Update S3Test.java
    
    * constant
---
 .../apache/pekko/stream/connectors/awsspi/s3/S3Test.java    | 13 ++++++++-----
 .../apache/pekko/stream/connectors/awsspi/s3/TestS3.scala   |  2 +-
 project/Dependencies.scala                                  |  1 +
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git 
a/aws-spi-pekko-http/src/test/java/org/apache/pekko/stream/connectors/awsspi/s3/S3Test.java
 
b/aws-spi-pekko-http/src/test/java/org/apache/pekko/stream/connectors/awsspi/s3/S3Test.java
index 1910b1165..48ef2a529 100644
--- 
a/aws-spi-pekko-http/src/test/java/org/apache/pekko/stream/connectors/awsspi/s3/S3Test.java
+++ 
b/aws-spi-pekko-http/src/test/java/org/apache/pekko/stream/connectors/awsspi/s3/S3Test.java
@@ -19,9 +19,10 @@ package org.apache.pekko.stream.connectors.awsspi.s3;
 
 import org.apache.pekko.actor.ActorSystem;
 import org.apache.pekko.stream.connectors.awsspi.PekkoHttpAsyncHttpService;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
 import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
 import software.amazon.awssdk.core.ResponseBytes;
 import software.amazon.awssdk.core.async.AsyncResponseTransformer;
@@ -41,17 +42,19 @@ import java.net.URISyntaxException;
 import java.security.SecureRandom;
 import java.util.concurrent.TimeUnit;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
+@Testcontainers
 public class S3Test {
 
+  public static final String S3_MOCK_VERSION = "4.10.0";
   private static final String AB = 
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
   private static SecureRandom rnd = new SecureRandom();
 
-  @Rule
+  @Container
   @SuppressWarnings("rawtypes")
   public GenericContainer<?> s3mock =
-      new GenericContainer("adobe/s3mock:2.17.0").withExposedPorts(9090);
+      new GenericContainer("adobe/s3mock:" + 
S3_MOCK_VERSION).withExposedPorts(9090);
 
   @Test
   public void testS3() throws Exception {
diff --git 
a/aws-spi-pekko-http/src/test/scala/org/apache/pekko/stream/connectors/awsspi/s3/TestS3.scala
 
b/aws-spi-pekko-http/src/test/scala/org/apache/pekko/stream/connectors/awsspi/s3/TestS3.scala
index c55b10bfc..28241f4ba 100644
--- 
a/aws-spi-pekko-http/src/test/scala/org/apache/pekko/stream/connectors/awsspi/s3/TestS3.scala
+++ 
b/aws-spi-pekko-http/src/test/scala/org/apache/pekko/stream/connectors/awsspi/s3/TestS3.scala
@@ -183,7 +183,7 @@ class TestS3 extends BaseAwsClientTest[S3AsyncClient] {
   override def exposedServicePort: Int = 9090
 
   override lazy val container: GenericContainer = new GenericContainer(
-    dockerImage = "adobe/s3mock:2.17.0",
+    dockerImage = s"adobe/s3mock:${S3Test.S3_MOCK_VERSION}",
     exposedPorts = Seq(exposedServicePort),
     waitStrategy = Some(TimeoutWaitStrategy(10.seconds)))
 }
diff --git a/project/Dependencies.scala b/project/Dependencies.scala
index 07cb5d39d..c0348c812 100644
--- a/project/Dependencies.scala
+++ b/project/Dependencies.scala
@@ -128,6 +128,7 @@ object Dependencies {
       "com.dimafeng" %% "testcontainers-scala" % 
TestContainersScalaTestVersion % Test,
       "com.github.sbt.junit" % "jupiter-interface" % 
JupiterKeys.jupiterVersion.value % Test,
       "org.junit.vintage" % "junit-vintage-engine" % 
JupiterKeys.junitVintageVersion.value % Test,
+      "org.testcontainers" % "testcontainers-junit-jupiter" % "2.0.2" % Test,
       "org.scalatest" %% "scalatest" % ScalaTestVersion % Test,
       "ch.qos.logback" % "logback-classic" % LogbackVersion % Test))
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to