We would like to state that the list of user objects contains an object with some of its fields having certain values, with a number of statements like this
assertThat(customObjectList, hasItem(hasProperty("someField", equalTo(someValue))));
However, the user object also has boolean fields, where the getter method has the prefix "is" instead of "get", and there the statement seems to fail with
java.lang.AssertionError: Expected: a collection containing hasProperty("booleanField", <true>) but: property "booleanField" is not readable
Is there a ready-made solution to overcome this, or should it be handled with some kind of user match?
source
share