Kafka-13158 Replace EasyMock and PowerMock with Mockito for ConnectClusterStateImpl Test and ConnectorPluginsResourceTest#11167
Closed
wycccccc wants to merge 1 commit intoapache:trunkfrom
Closed
Conversation
…usterStateImpl Test and ConnectorPluginsResourceTest
mimaison
reviewed
Feb 9, 2022
Member
mimaison
left a comment
There was a problem hiding this comment.
Thanks for the PR! I left a couple of comments
| testImplementation libs.powermockJunit4 | ||
| testImplementation libs.powermockEasymock | ||
| testImplementation libs.mockitoCore | ||
| testImplementation libs.mockitoInline // supports mocking static methods, final classes, etc. |
Member
There was a problem hiding this comment.
Why are we switching to mockitoInline? We don't seem to use any of these feature in this PR and according to the Mockito project, inline may be removed in the future when all of its features are integrated in core.
| @Mock | ||
| private Plugins plugins; | ||
| private ConnectorPluginsResource connectorPluginsResource; | ||
| @Captor |
Member
There was a problem hiding this comment.
We don't use these annotations in the other tests. Do you think we should not use them here to keep tests consistent? WDYT?
Contributor
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.
Development of EasyMock and PowerMock has stagnated while Mockito continues to be actively developed. With the new Java cadence, it's a problem to depend on libraries that do bytecode generation and are not actively maintained. In addition, Mockito is also easier to use.KAFKA-7438
Committer Checklist (excluded from commit message)