-
Improvement
-
Resolution: Fixed
-
Neutral
-
5.3.1
NodeMatchers currently provides several #hasNode(...) matchers, but only checking explicit name and node-type, as Strings.
In some cases where the node name doesn't necessarily matter, it would be handy to have a #hasNode(Matcher<Node>) method for evaluating child-nodes, in the similar spirit as #hasProperty(Matcher<Property>).
We can then add similar convenience methods for matching node name, or a node with a child node whose name matches further rules, e.g.:
assertThat(node, hasNode(hasProperty("property", "value"))); assertThat(node, hasNode(nodeName(endsWith("nut")))); assertThat(node, hasNode( Matchers.<Node> allOf( nodeName(endsWith("nut")), hasProperty("property", "value") ));
Acceptance criteria