bean-matchers icon indicating copy to clipboard operation
bean-matchers copied to clipboard

hasValidBeanEquals() does not work with properties that can't be null

Open aardbol opened this issue 6 years ago • 1 comments

Some properties can never be null and null checks are ignored in the equals method. But hasValidBeanEquals() doesn't take that into account because it needs the Bean.class as argument instead of a concrete object with these properties set. It therefore triggers a NullPointerException for those properties.

These properties could be excluded but that makes the test incomplete and is therefore not a recommended approach.

aardbol avatar Apr 19 '19 14:04 aardbol

Thanks for raising this @aardbol. Could you please provide an example bean class that doesn't work?

orien avatar Jan 09 '21 01:01 orien