Repository navigation
Upgrade WireMock to the latest 2.x in JUnit4to5Migration - #1182
Merged
Merged
Conversation
WireMockExtension only exists from WireMock 2.31.0, but com.github.tomakehurst:wiremock and wiremock-standalone end at 2.27.2, so the existing upgrade to 2.x left those modules without it. Move them to wiremock-jre8 and wiremock-jre8-standalone, which continue the 2.x line on Java 8, and upgrade all com.github.tomakehurst WireMock artifacts to the latest 2.x through declarative steps in JUnit4to5Migration.
Spring Boot 4 runs JUnit4to5Migration and JUnit5to6Migration in one run, so the wiremock-jre8 dependency from the former must end up on org.wiremock:wiremock 3.x through UpgradeWiremockDependencyVersion in the latter.
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.
UseWiremockExtension(part ofJUnit4to5Migration) rewritesWireMockRuletocom.github.tomakehurst.wiremock.junit5.WireMockExtension, which only exists from WireMock 2.31.0. Its nested upgrade ofcom.github.tomakehurst:wiremock*to2.xcould not help modules oncom.github.tomakehurst:wiremockorwiremock-standalone: both end at 2.27.2, and the 2.x line continues on Java 8 only aswiremock-jre8/wiremock-jre8-standalone(up to 2.35.2). Those modules then failedtestCompilewithpackage com.github.tomakehurst.wiremock.junit5 does not exist.This replaces the Java
getRecipeList()with declarative steps inJUnit4to5Migration, right afterUseWiremockExtension:ChangeDependencywiremockโwiremock-jre8andwiremock-standaloneโwiremock-jre8-standalone, both at2.x. The group stayscom.github.tomakehurst.UpgradeDependencyVersioncom.github.tomakehurst:wiremock*to2.x, withoverrideManagedVersion: true.Nothing moves to
org.wiremock3.x, which needs Java 11.Tests run the full
JUnit4to5Migrationon Maven projects with:wiremock-jre82.27.2 and 2.31.0wiremock2.27.2 andwiremock-standalone2.27.2dependencyManagementspring-cloud-contract-dependencies3.0.0, which overrideswiremock.version)JUnit5to6Migrationdrops the-jre8artifacts again: it already ends withUpgradeWiremockDependencyVersion, which moves everycom.github.tomakehurstWireMock artifact toorg.wiremock3.x (Java 11+). A test runsJUnit4to5MigrationandJUnit5to6Migrationtogether, as Spring Boot 4's upgrade does:wiremock2.27.2 ends onorg.wiremock:wiremock3.x. Outside this repo, aWireMockExtensiontest passed on JUnit 6.1.3 withorg.wiremock:wiremockandwiremock-standalone3.13.2, and withwiremock-jre8andwiremock-jre8-standalone2.35.2.