You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2026/03/12 16:09:39 UTC

[PR] Migrate all Java unit tests from JUnit 4 to JUnit 5 (Jupiter) [pekko-http]

He-Pin opened a new pull request, #984:
URL: https://github.com/apache/pekko-http/pull/984

   - Migrate 94 Java test files across all modules (docs, http-core, http-tests, http-marshallers-java, http2-tests, http-testkit)
   - Add JUnit 5 dependencies (5.9.3) and sbt-jupiter-interface plugin (0.11.0)
   - Create JUnit5RouteTest and ActorSystemExtension for JUnit 5 lifecycle
   - Convert @Test(expected=...) to assertThrows()
   - Reorder 3-arg assertion messages (JUnit 4 → JUnit 5 convention)
   - Convert @Ignore to @Disabled, @Before/@After to @BeforeEach/@AfterEach
   - Delete AllJavaTests.java (JUnit 4 Suite runner, replaced by auto-discovery)
   - Fix pre-existing printStackTrace() in Http2ClientApp.java
   - Preserve JUnitRouteTest and ActorSystemResource for library users (JUnit 4 API)
   - Run scalafmtAll and javafmtAll for formatting compliance
   
   All tests pass: http-testkit(23), http-core(1159), http-tests(1483), marshallers(6), http2(337), docs(509/510 - 1 pre-existing port conflict)
   
   Cross-reviewed by GPT-5.4, Gemini 3 Pro, and Claude Opus 4.6 - all approved.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Migrate all Java unit tests from JUnit 4 to JUnit 5 (Jupiter) [pekko-http]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin commented on code in PR #984:
URL: https://github.com/apache/pekko-http/pull/984#discussion_r2971499797


##########
project/plugins.sbt:
##########
@@ -31,6 +31,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.6")
 addSbtPlugin("com.github.pjfanning" % "sbt-source-dist" % "0.1.13")
 addSbtPlugin("com.github.pjfanning" % "sbt-pekko-build" % "0.4.7")
 addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0")
+addSbtPlugin("net.aichler" % "sbt-jupiter-interface" % "0.11.0")

Review Comment:
   @Philippus Feel free to take it and move further :), otherwise I can update it next weekend maybe.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Migrate all Java unit tests from JUnit 4 to JUnit 5 (Jupiter) [pekko-http]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on code in PR #984:
URL: https://github.com/apache/pekko-http/pull/984#discussion_r2971503738


##########
docs/src/test/java/docs/http/javadsl/server/directives/AttributeDirectivesExamplesTest.java:
##########
@@ -17,10 +17,10 @@
 import org.apache.pekko.http.javadsl.model.HttpRequest;
 import org.apache.pekko.http.javadsl.model.StatusCodes;
 import org.apache.pekko.http.javadsl.server.Route;
-import org.apache.pekko.http.javadsl.testkit.JUnitRouteTest;
-import org.junit.Test;
+import org.apache.pekko.http.javadsl.testkit.JUnit5RouteTest;

Review Comment:
   can we add JunitJupiterRouteTest and deprecate JUnit5RouteTest?
   
   Likewise, for any other Pekko classes branded JUnit5.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Migrate all Java unit tests from JUnit 4 to JUnit 5 (Jupiter) [pekko-http]

Posted by "He-Pin (via GitHub)" <gi...@apache.org>.
He-Pin merged PR #984:
URL: https://github.com/apache/pekko-http/pull/984


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Migrate all Java unit tests from JUnit 4 to JUnit 5 (Jupiter) [pekko-http]

Posted by "Philippus (via GitHub)" <gi...@apache.org>.
Philippus commented on code in PR #984:
URL: https://github.com/apache/pekko-http/pull/984#discussion_r2971496190


##########
project/plugins.sbt:
##########
@@ -31,6 +31,7 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.6")
 addSbtPlugin("com.github.pjfanning" % "sbt-source-dist" % "0.1.13")
 addSbtPlugin("com.github.pjfanning" % "sbt-pekko-build" % "0.4.7")
 addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0")
+addSbtPlugin("net.aichler" % "sbt-jupiter-interface" % "0.11.0")

Review Comment:
   This is an old version, see https://github.com/sbt/sbt-jupiter-interface?tab=readme-ov-file#usage.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Migrate all Java unit tests from JUnit 4 to JUnit 5 (Jupiter) [pekko-http]

Posted by "Philippus (via GitHub)" <gi...@apache.org>.
Philippus commented on code in PR #984:
URL: https://github.com/apache/pekko-http/pull/984#discussion_r2971493687


##########
build.sbt:
##########
@@ -39,6 +39,7 @@ inThisBuild(Def.settings(
   testOptions ++= Seq(
     Tests.Argument(TestFrameworks.JUnit, "-q", "-v"),
     Tests.Argument(TestFrameworks.ScalaTest, "-oDF")),
+  testFrameworks += new TestFramework("net.aichler.jupiter.api.JupiterFramework"),

Review Comment:
   is this line needed? Doesn't the `sbt-jupiter-interface` plugin do this already?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Migrate all Java unit tests from JUnit 4 to JUnit 5 (Jupiter) [pekko-http]

Posted by "Philippus (via GitHub)" <gi...@apache.org>.
Philippus commented on PR #984:
URL: https://github.com/apache/pekko-http/pull/984#issuecomment-4251540046

    nice work!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org