[test] remove PowerMockito from the classpath and replace the usages with Mockito - #14250
Merged
Merged
Conversation
eolivelli
approved these changes
Feb 11, 2022
eolivelli
left a comment
Contributor
There was a problem hiding this comment.
Lgtm as far as CI passes.
Please note that this patch will make it harder to cherry pick patches.
Please take into consideration a port to at least branch 2.9 and 2.8
eolivelli
requested changes
Feb 11, 2022
eolivelli
left a comment
Contributor
There was a problem hiding this comment.
Putting state into 'requested change' until CI passes
Contributor
Author
|
/pulsarbot rerun-failure-checks |
Contributor
Author
|
@eolivelli CI is green |
Contributor
Author
lhotari
requested review from
315157973,
BewareMyPower,
Jason918,
Technoboy-,
aahmed-se,
codelipenghui,
jerrypeng,
merlimat and
michaeljmarshall
February 12, 2022 07:23
hezhangjian
approved these changes
Feb 12, 2022
eolivelli
approved these changes
Feb 12, 2022
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.
Motivation
PowerMockito (mockito extension built on PowerMock) can be totally replaced with Mockito.
In this way we can remove the dependency
powermock-api-mockito2.We can also remove
powermock-module-testngartifact (and in turnpowermock-core) since it's not used anymore.The only artifact that doesn't have a simple replace path is
powermock-reflectwhich will remain in the classpath.The main reason behind the PowerMock usage reduction is that the project is semi-abandoned and it can easily break with newer jdk versions.
Modifications
MockedConstructionfeature.powermock-module-testngin favor ofpowermock-reflectDocumentation
no-need-doc