mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-26 17:09:05 +00:00
XpathResultMatcher supports Hamcrest Matcher NodeList
Use when xpath result is XPathConstants.NODESET
This commit is contained in:
committed by
Rossen Stoyanchev
parent
5ee990e045
commit
6db8306e46
+10
@@ -48,6 +48,16 @@ public class XpathResultMatchersTests {
|
||||
new XpathResultMatchers("/foo/bar", null).node(Matchers.nullValue()).match(getStubMvcResult()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nodeList() throws Exception {
|
||||
new XpathResultMatchers("/foo/bar", null).nodeList(Matchers.notNullValue()).match(getStubMvcResult());
|
||||
}
|
||||
|
||||
@Test(expected = AssertionError.class)
|
||||
public void nodeListNoMatch() throws Exception {
|
||||
new XpathResultMatchers("/foo/bar", null).nodeList(Matchers.nullValue()).match(getStubMvcResult());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void exists() throws Exception {
|
||||
new XpathResultMatchers("/foo/bar", null).exists().match(getStubMvcResult());
|
||||
|
||||
Reference in New Issue
Block a user