bean-matchers
bean-matchers copied to clipboard
hasValidBeanEquals() does not work with properties that can't be null
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.
Thanks for raising this @aardbol. Could you please provide an example bean class that doesn't work?