Skip to content

KAFKA-14133: Migrate various mocks in TaskManagerTest to Mockito#13874

Merged
divijvaidya merged 2 commits into
apache:trunkfrom
clolov:KAFKA-14133-PART11
Jul 20, 2023
Merged

KAFKA-14133: Migrate various mocks in TaskManagerTest to Mockito#13874
divijvaidya merged 2 commits into
apache:trunkfrom
clolov:KAFKA-14133-PART11

Conversation

@clolov

@clolov clolov commented Jun 19, 2023

Copy link
Copy Markdown
Contributor

This pull requests migrates the StreamTask, StandByTask, ProcessorStateManager and StreamProducer mocks in TaskManagerTest from EasyMock to Mockito.
The change is restricted to a single mock to minimize the scope and make it easier for review.

The reasoning as to why we would like to migrate a single mock rather than all mocks in the file at the same time has been discussed in #12607 (comment)

It takes the same approach as in:
#13529
#13621
#13681
#13711

@clolov
clolov requested review from cadonna and divijvaidya June 19, 2023 13:38
@clolov clolov added tests Test fixes (including flaky tests) streams labels Jun 19, 2023

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.

verify please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed this because it was never invoked.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The reason for this is that the method in which prepareRecycle is used is the mocked createStandbyTaskFromActive of standbyTaskCreator. Let me know in case I am wrong

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.

also, verifyNoMoreInteractions since the old easymock verify(producer) was verifying all invocations.

@clolov
clolov force-pushed the KAFKA-14133-PART11 branch from 62f188b to 5f4a61e Compare June 26, 2023 08:59
@clolov
clolov requested a review from divijvaidya June 26, 2023 08:59

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

Thank you for the changes Christo. Looks good to me.

(I have verified that TaskManagerTest is successful in the CI, rest all failures are unrelated to this change)

@divijvaidya
divijvaidya merged commit 8f313ea into apache:trunk Jul 20, 2023
jeqo pushed a commit to jeqo/kafka that referenced this pull request Jul 21, 2023
Cerchie pushed a commit to Cerchie/kafka that referenced this pull request Jul 25, 2023
jeqo pushed a commit to aiven/kafka that referenced this pull request Aug 15, 2023
@clolov
clolov deleted the KAFKA-14133-PART11 branch January 27, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

streams tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants