-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Nested tests are failing with new milestone version (5.13.0-M1), when running with Java 17.
Output from gradle build:
2025-03-22T17:04:12.060+0100 [DEBUG] [TestEventLogger] org.junit.platform.commons.PreconditionViolationException: First parameter must be implicit
2025-03-22T17:04:12.060+0100 [DEBUG] [TestEventLogger] at [email protected]/java.util.Optional.orElseGet(Optional.java:364)
2025-03-22T17:04:12.060+0100 [DEBUG] [TestEventLogger] at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
2025-03-22T17:04:12.060+0100 [DEBUG] [TestEventLogger] at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
2025-03-22T17:04:12.060+0100 [DEBUG] [TestEventLogger] at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
Using Java 21 works fine. Using Java 17 and version 5.12.1 also works.
Steps to reproduce
Clone samples repo (https://github.com/junit-team/junit5-samples) and switch to junit5-jupiter-starter-gradle.
Copy TestingAStackDemo from docs (https://junit.org/junit5/docs/current/user-guide/#writing-tests-nested) to gradle project.
Add toolchain config in build.gradle:
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
Switch to milestone dependency in build.gradle:
testImplementation(platform('org.junit:junit-bom:5.13.0-M1'))
Execute tests: ./gradlew clean test
Context
- Used versions (Jupiter/Vintage/Platform): 5.13.0-M1
- Build Tool/IDE: Gradle
Deliverables
- Remove usages of
Parameter.isImplicit()