Upgrade to JUnit 6.0.1 and prevent AOT scanning failure for JUnit 4 tests

This commit upgrades our test suite to use JUnit 6.0.1 and removes the
systemProperty("junit.platform.discovery.issue.severity.critical", "WARNING")
configuration from spring-test.gradle, so that all discovery issues will
fail the build for the spring-test module as well.

In addition, this commit prevents potential AOT test scanning failures
for JUnit 4 tests by setting the
"junit.vintage.discovery.issue.reporting.enabled" configuration
parameter to "false" in TestClassScanner.

See https://github.com/junit-team/junit-framework/issues/5030
Closes gh-35740
This commit is contained in:
Sam Brannen
2025-11-01 12:28:59 +01:00
parent f2cfc692cf
commit 324b254849
5 changed files with 19 additions and 8 deletions
@@ -46,9 +46,14 @@ import org.junit.platform.suite.api.Suite;
@SelectPackages("org.springframework.test.context")
@IncludeClassNamePatterns(".*Tests?$")
@ExcludeTags("failing-test-case")
@ConfigurationParameter(
key = "junit.platform.discovery.issue.severity.critical",
value = "INFO")
@ConfigurationParameter(
key = "junit.vintage.discovery.issue.reporting.enabled",
value = "false")
@ConfigurationParameter(
key = ClassOrderer.DEFAULT_ORDER_PROPERTY_NAME,
value = "org.junit.jupiter.api.ClassOrderer$ClassName"
)
value = "org.junit.jupiter.api.ClassOrderer$ClassName")
class SpringTestContextFrameworkTestSuite {
}