Recursive SamePropertyValuesAs matcher in hamcrest
-
03-12-2019 - |
Question
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?
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow