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

is*EqualsToByIgnoringFields #159

Open
martinsson opened this issue Jul 17, 2013 · 5 comments
Open

is*EqualsToByIgnoringFields #159

martinsson opened this issue Jul 17, 2013 · 5 comments

Comments

@martinsson
Copy link

It is very difficult to know what field made the assertion fail as the error message uses field values of expected and toString() on the actual. ex

java.lang.AssertionError: expected values:
<[null, 0.1, null, null, null, 3, null]>
in fields:
<['timestampMessage', 'altitude', 'latitude', 'longitude', 'timestampMesure', 'direction', 'vitesseInstantanee']>
of com.bla.bla.Localisation@2b2a653e.

I would suggest (and I'm willing to provide) the feature of printing a comparison of the fields that were used for the comparison instead. ex
java.lang.AssertionError: expected values:
<[null, 0.1, null, null, null, 3, null]>
in fields:
<['timestampMessage', 'altitude', 'latitude', 'longitude', 'timestampMesure', 'direction', 'vitesseInstantanee']>
of <[null, 2.1, null, null, null, 3, null]>.

What do you think?

@joel-costigliola
Copy link
Contributor

Yes, good idea, I would be very interested but for ... AssertJ (a fork of fest-assert-2.x).

@martinsson
Copy link
Author

So I just discovered FEST has been forked. I don't know what to do or think now.

@joel-costigliola
Copy link
Contributor

Fest is not active these days, a big refactoring is going on for month that does not seem to end, meanwhile no contribution are accepted. This is why, as an old Fest contributor, I decided to fork it (I would have preferred not to). The other reason is that the next Fest version will provide less assertions that the 2.x, which was not an option to me since I was using some of the "doomed" assertions.

Anyway using Fest or AssertJ is always better than JUnit base assertions !

@martinsson
Copy link
Author

Thank you for the information and explications joel.

Where can I find information about the rationale behind the refactoring and of reducing the number of assertions?

In the meanwhile I'll provide the discussed feature in assertj in a few days.

@joel-costigliola
Copy link
Contributor

It comes from a conversation I had with Alex (Fest creator) few months ago.

Alex is now working for Android's team and he does not have a lot of time to give to Fest (it may change in the future) he thought that reducing the number of assertions would make the project easier to maintain, his plan was to offer a small core of assertions and let users extend it, but IMHO if a user adds a new assertion it should be shared.

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

No branches or pull requests

2 participants