Skip to content

Kafka-13158 Replace EasyMock and PowerMock with Mockito for ConnectClusterStateImpl Test and ConnectorPluginsResourceTest#11167

Closed
wycccccc wants to merge 1 commit intoapache:trunkfrom
wycccccc:testConnectClusterStateImplTest
Closed

Kafka-13158 Replace EasyMock and PowerMock with Mockito for ConnectClusterStateImpl Test and ConnectorPluginsResourceTest#11167
wycccccc wants to merge 1 commit intoapache:trunkfrom
wycccccc:testConnectClusterStateImplTest

Conversation

@wycccccc
Copy link
Copy Markdown
Contributor

@wycccccc wycccccc commented Aug 3, 2021

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)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

…usterStateImpl Test and ConnectorPluginsResourceTest
@ijuma ijuma requested a review from mimaison February 5, 2022 05:48
Copy link
Copy Markdown
Member

@mimaison mimaison left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I left a couple of comments

Comment thread build.gradle
testImplementation libs.powermockJunit4
testImplementation libs.powermockEasymock
testImplementation libs.mockitoCore
testImplementation libs.mockitoInline // supports mocking static methods, final classes, etc.
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.

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
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.

We don't use these annotations in the other tests. Do you think we should not use them here to keep tests consistent? WDYT?

@yashmayya
Copy link
Copy Markdown
Contributor

Closing this since the tests here were migrated to Mockito in #11572 and #12423

@yashmayya yashmayya closed this Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants