Details
-
Improvement
-
Resolution: Fixed
-
Neutral
-
None
-
None
Description
It'd be useful to have matchers like hasProperty() where we can match on the property's name, value, or anything.
Example use cases:
assertThat(node, allOf(
hasProperty(propertyName(containsString("y"))),
hasProperty("abc", containsString("oo")),
hasProperty(
Matchers.<Property>allOf(
propertyName(containsString("ef")),
propertyValue(isA(Long.class))
)
)
));
// It's a pity we have to help the either().or() matcher with generics here, but I couldn't find a way around that. Other option is to use anyOf() which I find less readable.
assertThat(node, everyProperty(Matchers.<Property>either(propertyName(startsWith("jcr:"))).or(propertyValue(equalTo("mgnl:dummyNode")))));
Checklists
Acceptance criteria