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
@@ -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