Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-13133: Replace EasyMock and PowerMock with Mockito for AbstractHerderTest #12473

Merged
merged 8 commits into from Aug 23, 2022

Conversation

divijvaidya
Copy link
Contributor

This PR is created on top of abandoned PR #11137. I have added the previous author's comment in this PR for attribution. I have also addressed the pending comments from @mimaison in this PR.

Notes to help the reviewer:

  • When we run the tests using @RunWith(MockitoJUnitRunner.StrictStubs.class) Mockito performs a verify() for all stubs that are mentioned, hence, there is no need to explicitly verify the stubs (unless you want to verify the number of times etc.). Note that this does not work for static mocks.

Testing

./gradlew connect:runtime:unitTest --tests AbstractHerderTest is successful.

}

@Test
public void testConnectorStatus() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reviewers, please note that we have removed this test completely since it is duplicated by another existing test connectorStatus.

@divijvaidya
Copy link
Contributor Author

@C0urante this is ready for your review when you get some time. Thank you!

@ijuma
Copy link
Contributor

ijuma commented Aug 10, 2022

@mimaison @C0urante Can one of you please review this and get it over the line?

@C0urante
Copy link
Contributor

@ijuma @divijvaidya I'm pretty tied up this week and next, but can definitely provide a first review by the end of the week after. Please feel free to ping me if I still haven't left a review by Friday, August 26th.

Copy link
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! It looks good, I left a few minor suggestions.

@MockStrict private ConfigBackingStore configStore;
@MockStrict private StatusBackingStore statusStore;
@MockStrict private ClassLoader classLoader;
@Mock private Worker worker;
Copy link
Member

Choose a reason for hiding this comment

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

I think we can also remove the TASK_CONFIGS constant above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did not understand the reason for your suggestion. TASK_CONFIGS is being used to create a ClusterConfigState containing tasks which are used in testConnectors() and testReverseTransformConfigs() tests.

Could you please help me understand the rationale here?

Copy link
Member

@mimaison mimaison Aug 23, 2022

Choose a reason for hiding this comment

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

My bad, somehow IDEA marked it as unused but, as you said, it is used!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for clarifying. In that case, the PR is ready for your review. I have addressed rest of your comments.

@C0urante
Copy link
Contributor

Since this is already receiving attention, I'll redirect my focus to other PRs that haven't gotten anything yet for now.

@mimaison Please LMK if you'd like me to lend a hand on this one though :)

Copy link
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, LGTM

@mimaison
Copy link
Member

Tests passed locally, the CI failure KRaftClusterTest > testCreateClusterAndCreateListDeleteTopic() FAILED is unrelated. Merging to trunk.

@mimaison mimaison merged commit 4b310d1 into apache:trunk Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants