Repository navigation
Run the full Cucumber-JVM 7.x upgrade from JUnit4to5Migration - #1181
Merged
Merged
Conversation
`CucumberToJunitPlatformSuite` only converts the `io.cucumber.junit.Cucumber` runner, so the `cucumber.api.junit.Cucumber` runner of Cucumber-JVM 4.x and earlier was left in place once `junit:junit` was removed. `UpgradeCucumber7x` first moves those types to `io.cucumber` and the dependencies to 7.x, and ends with the suite migration.
timtebeek
added a commit
to openrewrite/rewrite-cucumber-jvm
that referenced
this pull request
Oct 9, 2026
`JUnit4to5Migration` is to run `UpgradeCucumber7x` rather than only `CucumberToJunitPlatformSuite` (openrewrite/rewrite-testing-frameworks#1181), so the suite migration no longer needs to hold back on modules below 7.x. `CucumberToJunitPlatformSuite` again migrates the runner and swaps the dependency wherever it runs, still moving the rest of the Cucumber-JVM dependencies along to the same 7.x.
timtebeek
added a commit
to openrewrite/rewrite-cucumber-jvm
that referenced
this pull request
Oct 9, 2026
* Keep the cucumber-junit-platform-engine swap resolvable The swap of `cucumber-junit` for `cucumber-junit-platform-engine` in `CucumberToJunitPlatformSuite` carried over the old version, which does not exist before 5.0.0, and left the engine without a version where a parent managed `cucumber-junit`. Either way Maven could no longer read the pom. - The engine now moves to 7.x, adding a version only where nothing manages it. - The rest of the Cucumber-JVM dependencies move to that same 7.x, as the engine fails to run against a `cucumber-core` of any other release. - On its own, as from `JUnit4to5Migration`, the JUnit 4 runner is only migrated in modules already on Cucumber-JVM 7.x; `UpgradeCucumber7x` still migrates it from any version. - `junit-platform-suite` is also added for the `cucumber.api` runner, which `UpgradeCucumber7x` renames and migrates in the same run. * Move a cucumber-bom import before overriding managed versions With `overrideManagedVersion`, `UpgradeDependencyVersion` looks for the release of an importing BOM that manages each dependency at the target version, downloading one `cucumber-bom` pom after another. Moving the import to the latest 7.x first leaves nothing newer to look for. * Drop the Cucumber-JVM 7.x gate on the JUnit 4 runner migration `JUnit4to5Migration` is to run `UpgradeCucumber7x` rather than only `CucumberToJunitPlatformSuite` (openrewrite/rewrite-testing-frameworks#1181), so the suite migration no longer needs to hold back on modules below 7.x. `CucumberToJunitPlatformSuite` again migrates the runner and swaps the dependency wherever it runs, still moving the rest of the Cucumber-JVM dependencies along to the same 7.x. * Condense the CucumberToJunitPlatformSuite tests to one per pom shape
…ndencies to 7.x
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.
#1178 had
JUnit4to5MigrationrunCucumberToJunitPlatformSuite, which only converts theio.cucumber.junit.Cucumberrunner. Tests still on thecucumber.api.junit.Cucumberrunner, which Cucumber-JVM removed in 5.0, kept it afterjunit:junitwas removed, so they still failed to compile.The migration now runs
UpgradeCucumber7x, which moves thecucumber.apitypes toio.cucumberand then runs the same suite migration. Since openrewrite/rewrite-cucumber-jvm#69, that suite migration also moves all Cucumber-JVM dependencies to 7.x, so the code migrations inUpgradeCucumber7xneed to come along.cucumber4RunnerBecomesSuitecovers a Cucumber-JVM 4.8.1 runner and its pom. It addscucumber-coreandcucumber-junit4.8.1 to the test type table.Closes openrewrite/rewrite-cucumber-jvm#1: running
JUnit4to5Migrationnow migrates a Cucumber project from JUnit 4 to JUnit 5, covering the runner and the rest of the JUnit 4 usage, so rewrite-cucumber-jvm need not depend on rewrite-testing-frameworks as that issue proposed.