Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
Comment on lines +104 to +109
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.

</dependencies>

<build>
Expand Down
38 changes: 6 additions & 32 deletions src/test/java/com/dropwizard/employee/AppTest.java
Original file line number Diff line number Diff line change
@@ -1,38 +1,12 @@
package com.dropwizard.employee;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}

/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
class AppTest {

/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
@Test
void testApp() {
assertTrue(true);
}
}