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
The text was updated successfully, but these errors were encountered:
kozlovda
changed the title
sameBeanAs(...).with("superclassField", matcher) fails with "superclassField does not exist"
sameBeanAs(...).with("inheritedField", matcher) fails with "inheritedField does not exist" if set to check inherited field
Mar 23, 2015
nieldw
added a commit
to nieldw/shazamcrest
that referenced
this issue
Aug 8, 2017
Hi,
The issue above happens when field is inherited from one of super-classes of the tested bean.
This happens due to shallow lookup of the field at
BeanFinder.java:33
:As per
getDeclaredFields()
javadoc it doesn't return inherited fields:Basically, it seems reasonable to update field lookup to search through inherited fields as well (
with all).field shadowing
logic in placeThanks in advance for looking into this!
Update
Shadowing is not supported by GSON, so this goes off.
Test case:
The text was updated successfully, but these errors were encountered: