package com.jayway.jsonpath.matchers;

import org.junit.Test;

import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasNoJsonPath;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;

public class HasNoJsonPathTest {
    private static final String JSON_STRING = "{" +
            "\"name\": \"Jessie\"" +
            "}";

    @Test
    public void shouldMatchMissingJsonPath() {
        assertThat(JSON_STRING, hasNoJsonPath("$.not_there"));
    }

    @Test
    public void shouldNotMatchExistingJsonPath() {
        assertThat(JSON_STRING, not(hasNoJsonPath("$.name")));
    }

    @Test
    public void shouldBeDescriptive() {
        assertThat(hasNoJsonPath("$.name"),
                hasToString(equalTo("is json without json path \"$['name']\"")));
    }

}

@@ -295,24 +295,56 @@
 ING = %22%7B%22 +%0A
+            %22%5C%22none%5C%22: null,%22 +%0A
             
@@ -636,32 +636,159 @@
 ame%22)));%0A    %7D%0A%0A
+    @Test%0A    public void shouldNotMatchExplicitNull() %7B%0A        assertThat(JSON_STRING, not(hasNoJsonPath(%22$.none%22)));%0A    %7D%0A%0A
     @Test%0A    pu

Add hasNoJsonPath testcase for explicit null