You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ComparingProperties collect the properties scanning the declared method for each class in the hierarchy.
In particular, the method gettersIncludingInheritedOf(Class) collect all the methods declared in the passed class object using the Class.getDeclaredMethods() API and iterate the process considering the superclass until the fundamental package java.lang.
In this way, this implementation takes into account only the properties inherited by the extension, and that's the reason why the default methods, declared in the interfaces, are ignored.
I think that collecting the properties using the getMethods API should be a better approach because:
it returns all public methods considering both superclasses and interfaces
there's no need to filter public methods
there's no need to iterate through the class hierarchy
I create a PR to let the AssertJ maintainers evaluate the fix proposal.
If an Object has methods defined as default methods in an interface, these are not detected by the ComparingProperties() introspection strategy:
for example:
expected:
ComparingProperties should also detect properties defined in as default methods in interfaces implemented by the target object.
The text was updated successfully, but these errors were encountered: