Reputation: 11592
I am looking for a hamcrest matcher that behaves the same way as SamePropertyValuesAs but with the added twist that if a property is not a primitive, one of the standard Java classes (string, integer e.t.c.), or a compound of one of those (collection or array) then it will do a recursive match on those properties as well.
Is there such a matcher out there or will I have to roll my own?
Upvotes: 5
Views: 4619
Reputation: 11592
The underlying issue can now be addressed by a library written by engineers at Shazam (where I work). It is a bean comparison library called Shazamcrest.
It is very powerfull and generates very nice diagnostics.
https://github.com/shazam/shazamcrest
Upvotes: 9