Details
-
Improvement
-
Resolution: Won't Do
-
Neutral
-
None
-
None
-
None
-
None
-
-
Empty show more show less
-
Basel 70
-
3
Description
The following matcher is seen in multiple projects:
- rest-tools
- resources
- UI
- templating-samples
private Matcher<? super Node> hasChildWhich(final Matcher<Node> matcher) {
return new TypeSafeMatcher<Node>() {
@Override
protected boolean matchesSafely(Node node) {
try {
return NodeUtil.getNodes(node, o -> matcher.matches(o)).iterator().hasNext();
} catch (RepositoryException e) {
throw new RuntimeException(e);
}
}
@Override
public void describeTo(Description description) {
description.appendText("a node with a child with ");
matcher.describeTo(description);
}
};
}
It would be nice to add it to our collection and use it from there directly.
Checklists
Acceptance criteria