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

chore: add equals, hashCode, and toString methods to client interface impls #5681

Merged
merged 2 commits into from
Jun 25, 2020

Conversation

vcrfxia
Copy link
Contributor

@vcrfxia vcrfxia commented Jun 24, 2020

Description

Context: #5671 (comment)

Testing done

Non-functional change.

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@vcrfxia vcrfxia requested a review from a team as a code owner June 24, 2020 23:39
@vcrfxia vcrfxia requested a review from agavra June 24, 2020 23:40
Copy link
Contributor

@agavra agavra left a comment

Choose a reason for hiding this comment

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

Probably a good idea to also add EqualsTester tests for this

Copy link
Contributor

@big-andy-coates big-andy-coates left a comment

Choose a reason for hiding this comment

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

Can you please add unit tests for this new methods?

Otherwise, what tends to happen is people come add new fields and forget to add them to equals and hashcode.

You can test them using the Guava EqualsTester

@vcrfxia
Copy link
Contributor Author

vcrfxia commented Jun 25, 2020

Added EqualsTester tests, though I'm confused about the statement

Otherwise, what tends to happen is people come add new fields and forget to add them to equals and hashcode.

If someone added a new field, the EqualsTester test wouldn't actually fail, right?. The EqualsTester test is only useful for catching these slip-ups if the person updating the class happens to spot the test in the unit test file and thinks to update the test.

@vcrfxia vcrfxia merged commit 9bbd2ae into confluentinc:master Jun 25, 2020
@vcrfxia vcrfxia deleted the java-client-interface-methods branch June 25, 2020 22:30
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