braintree / braintree_java

Braintree Java library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
158 stars 98 forks source link

equals() and hashCode() methods are missing in classed provided by SDK #63

Open kmichalak opened 6 years ago

kmichalak commented 6 years ago

General information

Issue description

Looks like equals() and hashCode() methods are not available for classes provided by SDK. It makes integration and unit testing much harder, as custom assertions/matchers are needed to check for example if com.braintreegateway.Trasanction instance contains all necessary data. Currenlty to assert an object state I have to implement customer Hamcrest matcher, create long list of assertions (what is not the best idea from test design or good practices perspective) or use additional tools to perform reflection based comparison. Adding implementation for equals() and hashCode() methods will simplify testing process.

quinnjn commented 6 years ago

I agree that it would be nice to have these methods implemented.

We'll keep this in mind as we try out lombok (mentioned in #57) which looks like it is able to generate equals and hashCode methods.

hollabaq86 commented 2 years ago

for internal notekeeping, ticket 630