|
|
|
|
@ -43,18 +43,29 @@ public class XpathResultMatchersTests {
@@ -43,18 +43,29 @@ public class XpathResultMatchersTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void nodeNoMatch() throws Exception { |
|
|
|
|
public void nodeNoMatch() { |
|
|
|
|
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> |
|
|
|
|
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 |
|
|
|
|
public void nodeListNoMatch() { |
|
|
|
|
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> |
|
|
|
|
new XpathResultMatchers("/foo/bar", null).nodeList(Matchers.nullValue()).match(getStubMvcResult())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void exists() throws Exception { |
|
|
|
|
new XpathResultMatchers("/foo/bar", null).exists().match(getStubMvcResult()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void existsNoMatch() throws Exception { |
|
|
|
|
public void existsNoMatch() { |
|
|
|
|
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> |
|
|
|
|
new XpathResultMatchers("/foo/Bar", null).exists().match(getStubMvcResult())); |
|
|
|
|
} |
|
|
|
|
@ -65,7 +76,7 @@ public class XpathResultMatchersTests {
@@ -65,7 +76,7 @@ public class XpathResultMatchersTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void doesNotExistNoMatch() throws Exception { |
|
|
|
|
public void doesNotExistNoMatch() { |
|
|
|
|
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> |
|
|
|
|
new XpathResultMatchers("/foo/bar", null).doesNotExist().match(getStubMvcResult())); |
|
|
|
|
} |
|
|
|
|
@ -76,7 +87,7 @@ public class XpathResultMatchersTests {
@@ -76,7 +87,7 @@ public class XpathResultMatchersTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void nodeCountNoMatch() throws Exception { |
|
|
|
|
public void nodeCountNoMatch() { |
|
|
|
|
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> |
|
|
|
|
new XpathResultMatchers("/foo/bar", null).nodeCount(1).match(getStubMvcResult())); |
|
|
|
|
} |
|
|
|
|
@ -87,7 +98,7 @@ public class XpathResultMatchersTests {
@@ -87,7 +98,7 @@ public class XpathResultMatchersTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void stringNoMatch() throws Exception { |
|
|
|
|
public void stringNoMatch() { |
|
|
|
|
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> |
|
|
|
|
new XpathResultMatchers("/foo/bar[1]", null).string("112").match(getStubMvcResult())); |
|
|
|
|
} |
|
|
|
|
@ -98,7 +109,7 @@ public class XpathResultMatchersTests {
@@ -98,7 +109,7 @@ public class XpathResultMatchersTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void numberNoMatch() throws Exception { |
|
|
|
|
public void numberNoMatch() { |
|
|
|
|
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> |
|
|
|
|
new XpathResultMatchers("/foo/bar[1]", null).number(111.1).match(getStubMvcResult())); |
|
|
|
|
} |
|
|
|
|
@ -109,7 +120,7 @@ public class XpathResultMatchersTests {
@@ -109,7 +120,7 @@ public class XpathResultMatchersTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void booleanValueNoMatch() throws Exception { |
|
|
|
|
public void booleanValueNoMatch() { |
|
|
|
|
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> |
|
|
|
|
new XpathResultMatchers("/foo/bar[2]", null).booleanValue(false).match(getStubMvcResult())); |
|
|
|
|
} |
|
|
|
|
|