Browse Source

Merge pull request #424 from RyanBard/AddTestCaseForHasNoJsonPath

Add hasNoJsonPath testcase for explicit null
pull/517/head
kallestenflo 6 years ago committed by GitHub
parent
commit
aff78420aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      json-path-assert/src/test/java/com/jayway/jsonpath/matchers/HasNoJsonPathTest.java

6
json-path-assert/src/test/java/com/jayway/jsonpath/matchers/HasNoJsonPathTest.java

@ -8,6 +8,7 @@ import static org.junit.Assert.assertThat;
public class HasNoJsonPathTest {
private static final String JSON_STRING = "{" +
"\"none\": null," +
"\"name\": \"Jessie\"" +
"}";
@ -21,6 +22,11 @@ public class HasNoJsonPathTest {
assertThat(JSON_STRING, not(hasNoJsonPath("$.name")));
}
@Test
public void shouldNotMatchExplicitNull() {
assertThat(JSON_STRING, not(hasNoJsonPath("$.none")));
}
@Test
public void shouldBeDescriptive() {
assertThat(hasNoJsonPath("$.name"),

Loading…
Cancel
Save