We would like to assert that a list of custom objects contains an object with some of its fields having certain values, with a series of assertions like this
assertThat(customObjectList, hasItem(hasProperty("someField", equalTo(someValue))));
However the custom object has also boolean type fields, where the getter method has an "is" prefix instead of "get", and there the assertion seems to fail with
java.lang.AssertionError: Expected: a collection containing hasProperty("booleanField", <true>) but: property "booleanField" is not readable
Is there an out-of-the-box solution to overcome this, or it should be handled with some kind of custom matcher?
boolean
s. Are you maybe talking aboutBoolean
Objects? – Perforce