Skip to content

[test] remove PowerMockito from the classpath and replace the usages with Mockito - #14250

Merged
eolivelli merged 7 commits into
apache:masterfrom
nicoloboschi:test/remove-powermockito
Feb 12, 2022
Merged

[test] remove PowerMockito from the classpath and replace the usages with Mockito#14250
eolivelli merged 7 commits into
apache:masterfrom
nicoloboschi:test/remove-powermockito

Conversation

@nicoloboschi

@nicoloboschi nicoloboschi commented Feb 11, 2022

Copy link
Copy Markdown
Contributor

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-testng artifact (and in turn powermock-core) since it's not used anymore.
The only artifact that doesn't have a simple replace path is powermock-reflect which 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

  • Replaced PowerMockito with Mockito classes (just changing the packages)
  • Replaced PowerMockito constructor mock with Mockito MockedConstruction feature.
  • Removed the module powermock-module-testng in favor of powermock-reflect

Documentation

  • no-need-doc

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Feb 11, 2022

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting state into 'requested change' until CI passes

@nicoloboschi

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@nicoloboschi

Copy link
Copy Markdown
Contributor Author

@eolivelli CI is green

@nicoloboschi

Copy link
Copy Markdown
Contributor Author

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@eolivelli
eolivelli merged commit dc602c0 into apache:master Feb 12, 2022
@codelipenghui codelipenghui added this to the 2.10.0 milestone Apr 19, 2022
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants