Repository navigation
Bump wiremock-core parser classpath and keep the class prefix when removing PowerMock runners - #1201
Merged
Merged
Conversation
…eep the class prefix intact
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
WireMock 4 parser classpath
Bumps the pinned WireMock 4 parser classpath entry to the newest beta. That is the same version the
wiremock4.ymlmigration already upgrades to.parserClasspathorg.wiremock:wiremock-core4.0.0-beta.384.0.0-beta.40The version stays pinned. There is no 4.0.0 GA yet, and since rewrite-build-gradle-plugin 2.27.2 dynamic versions no longer resolve to pre-releases, so
4.+would match nothing. A trailing comment on the pin now says so.The
classpathFromResourcesnames don't include a version (wiremock-core-4), so no recipe or test code needs to change.I regenerated the type table with
./gradlew --refresh-dependencies createTypeTableusing rewrite-build-gradle-plugin 2.27.2. The only GAV change iswiremock-core 4.0.0-beta.38 → 4.0.0-beta.40.Blank line left when removing
@RunWith(PowerMockRunner.class)Three tests in
ReplacePowerMockitoIntegrationTestfailed onmainwith an extra blank line before the class (mockingInheritedStaticMethodIsDisabled,mockingStaticMethodsOfSystemIsDisabled,thatPowerMockitoIsReplacedInTestNGTests).PowerMockRunnerDelegateToRunWithdropped@RunWith(PowerMockRunner.class)from the class's annotation list without moving its prefix along, so the next annotation kept its own leading newline. Since openrewrite/rewrite#9253,RemoveAnnotationVisitorhands the first removed annotation's prefix to whatever follows it. So when@PrepareForTestwas removed afterwards, that stray newline ended up before the class and added a blank line.The recipe now removes both
@RunWith(PowerMockRunner.class)and@PowerMockRunnerDelegatethroughRemoveAnnotationVisitor, which keeps the class prefix intact.PowerMockRunnerDelegateToRunWithTest.removesRunWithPowerMockRunnerWithoutDelegatehad the old double blank line written into its expected output, so it now expects a single blank line.Testing
org.openrewrite.java.testing.wiremockpass.org.openrewrite.java.testing.mockitopass (2 skipped).