Migrate AppTest from JUnit 3 to JUnit 5 (Jupiter)#37
Migrate AppTest from JUnit 3 to JUnit 5 (Jupiter)#37devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
- Replace JUnit 3 TestCase-based test with JUnit 5 Jupiter annotations - Remove TestCase inheritance, constructor, and suite() method - Use @test annotation and static Assertions import - Add junit-jupiter 5.10.0 dependency to pom.xml Co-Authored-By: Wes Convery <2wconvery@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| <dependency> | ||
| <groupId>org.junit.jupiter</groupId> | ||
| <artifactId>junit-jupiter</artifactId> | ||
| <version>5.10.0</version> | ||
| <scope>test</scope> | ||
| </dependency> |
There was a problem hiding this comment.
🔴 maven-surefire-plugin 2.19.1 cannot discover JUnit 5 tests, causing tests to be silently skipped
The PR migrates AppTest from JUnit 3 to JUnit 5 (Jupiter), but the maven-surefire-plugin is pinned to version 2.19.1 (pom.xml:128). This version predates native JUnit Platform support, which was introduced in surefire 2.22.0. As a result, the surefire plugin will not discover or execute any JUnit 5 tests during mvn test. The build will succeed with 0 tests run, silently breaking test execution. Before this PR, the JUnit 3 test was being discovered and executed correctly.
Prompt for agents
The maven-surefire-plugin version at pom.xml:128 is 2.19.1, which does not support JUnit 5 / JUnit Platform. JUnit 5 requires surefire 2.22.0 or later for native test discovery. The fix is to update the maven-surefire-plugin version in the pluginManagement section (pom.xml:125-129) to at least 2.22.0 (e.g., 3.0.0-M7 or later). Without this change, all JUnit 5 tests will be silently skipped during mvn test.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
This is a known limitation and intentionally not addressed in this PR. A separate companion PR is upgrading maven-surefire-plugin to 3.1.2, which will enable JUnit 5 test discovery. This PR is scoped only to the test migration and dependency addition, per the task requirements.
Summary
Rewrites
AppTest.javafrom JUnit 3 style (extendingTestCase, manual suite construction) to JUnit 5 Jupiter style (@Testannotation, staticAssertionsimport). Adds an explicitjunit-jupiter 5.10.0test dependency topom.xmlsince the current Dropwizard 1.0.5 BOM does not provide JUnit 5 transitively.Review & Testing Checklist for Human
maven-surefire-pluginversion is 2.19.1, which does not natively support JUnit 5. Tests will likely be silently skipped bymvn testuntil surefire is upgraded to 3.x (handled by a separate PR). Verify this is acceptable as an intermediate state.junit-jupiter 5.10.0does not introduce dependency convergence issues with the existing Dropwizard 1.0.5 dependency tree (the enforcer plugin runsDependencyConvergence).Notes
mvn testto confirm the JUnit 5 test is discovered and executed.Link to Devin session: https://app.devin.ai/sessions/3c0297ca288d44438a40638c0e560e95
Requested by: @WesternConcrete