mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
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:
+6
-1
@@ -142,7 +142,12 @@ class TestClassScanner {
|
||||
if (packageNames.length > 0) {
|
||||
builder.filters(includePackageNames(packageNames));
|
||||
}
|
||||
LauncherDiscoveryRequest request = builder.build();
|
||||
LauncherDiscoveryRequest request = builder
|
||||
// In case junit.platform.discovery.issue.severity.critical=INFO has been configured,
|
||||
// we do not want scanning to fail due to the deprecation of the Vintage test engine.
|
||||
// So, we disable reporting of the deprecation discovery issue.
|
||||
.configurationParameter("junit.vintage.discovery.issue.reporting.enabled", "false")
|
||||
.build();
|
||||
Launcher launcher = LauncherFactory.create();
|
||||
TestPlan testPlan = launcher.discover(request);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user