Repository navigation
Conversation
JUnit4to5Migration added junit-platform-launcher at the newest 1.x, which in a Spring Boot build is newer than the JUnit Platform that Spring Boot manages, and the tests then can't start. Where the Spring Boot and Spring dependency management plugins are applied, the launcher is now added without a version, so Spring Boot manages it, as Spring Initializr does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's changed
JUnit4to5Migrationnow addsorg.junit.platform:junit-platform-launcherwithout a version to a Gradle build that applies the Spring Boot and Spring dependency management plugins, as Spring Initializr does. Spring Boot then manages the launcher at the JUnit Platform version it manages for the Jupiter engine.The new declarative recipe
AddJUnitPlatformLauncherManagedBySpringBootruns just before the existingAddDependencythat adds the launcher at1.x. That one then skips the build, because the configuration already requests the launcher. Builds without those two plugins get the launcher as before.What's your motivation?
In a Spring Boot build,
version: 1.xpicks the newest launcher, 1.14.4, while Spring Boot 3.5 manages JUnit Platform 1.12. The tests can't start:The public repository UKHomeOffice/hocs-workflow ran 919 tests before its migration to Spring Boot 3.5. After the migration it got
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.14.4"and ran none. With the launcher left versionless, all 919 tests run again.Any additional context
JUnit5MigrationTest.springBootGradleBuildGetsTheLauncherSpringBootManagesfails without the change tojunit5.yml, where the launcher gets:1.14.4, and passes with it.JUnit5MigrationTestpasses in full (30 tests). I didn't run the rest of the suite.recipes.csvgets the new recipe's row and +3 on the counts of the four recipes that include it. RunningrecipeCsvGeneratelocally also changed unrelated rows, because local dependency versions differ, so I left those out.recipeCsvValidatepasses.