Skip to content

Migrate AppTest from JUnit 3 to JUnit 5 (Jupiter)#37

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776966590-migrate-junit3-to-junit5
Open

Migrate AppTest from JUnit 3 to JUnit 5 (Jupiter)#37
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1776966590-migrate-junit3-to-junit5

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Summary

Rewrites AppTest.java from JUnit 3 style (extending TestCase, manual suite construction) to JUnit 5 Jupiter style (@Test annotation, static Assertions import). Adds an explicit junit-jupiter 5.10.0 test dependency to pom.xml since the current Dropwizard 1.0.5 BOM does not provide JUnit 5 transitively.

Review & Testing Checklist for Human

  • Surefire compatibility: The current maven-surefire-plugin version is 2.19.1, which does not natively support JUnit 5. Tests will likely be silently skipped by mvn test until surefire is upgraded to 3.x (handled by a separate PR). Verify this is acceptable as an intermediate state.
  • Confirm junit-jupiter 5.10.0 does not introduce dependency convergence issues with the existing Dropwizard 1.0.5 dependency tree (the enforcer plugin runs DependencyConvergence).

Notes

  • Once the companion surefire upgrade PR is merged, run mvn test to confirm the JUnit 5 test is discovered and executed.

Link to Devin session: https://app.devin.ai/sessions/3c0297ca288d44438a40638c0e560e95
Requested by: @WesternConcrete

- 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-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread pom.xml
Comment on lines +104 to +109
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant