XpathResultMatchers to support Hamcrest Matcher<NodeList> [SPR-17529] #22061
Labels
in: test
Issues in the test module
status: superseded
An issue that has been superseded by another
type: enhancement
A general enhancement
Pat Turner opened SPR-17529 and commented
While org.springframework.test.web.servlet.result.XpathResultMatchers supports Hamcrest matcher against a single org.w3c.dom.Node, it doesn't allow matching against multiple nodes via the org.w3c.dom.NodeList.
Suggest addition of a new ResultMatcher method in XpathResultMatchers and supporting XpathExpectationsHelper:
public ResultMatcher nodeList(final Matcher<? super NodeList> matcher)
My motivation for this is to allow checking that XHTML element IDs are unique across the document, and to do this, I need to match all elements with an ID.
E.g.
//*[@id]
Happy to contribute if you think this is worthwhile adding to framework.
Affects: 5.1.2
Referenced from: pull request #2023
The text was updated successfully, but these errors were encountered: