bbenet / json-path

Automatically exported from code.google.com/p/json-path
0 stars 0 forks source link

assertNotDefined not works #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

    @Test
    public void testNotDefined() throws Exception {
        JsonAsserter asserter = JsonAssert.with("{\"foo\":\"bar\"}");
        asserter.assertEquals("$.foo", "bar"); // pass
        asserter.assertEquals("$foo", "bar"); // pass
        asserter.assertNotDefined("$.xxx"); // fail but should be pass
        asserter.assertNotDefined("$xxx"); // fail  but should be pass
    }

What version of the product are you using? On what operating system?

jsonpath,jsonasserter  0.91 from maven repository

Please provide any additional information below.

//    com.jayway.jsonassert.impl.JsonAsserterImpl
//    public JsonAsserter assertNotDefined(String path) {
//
//        try {
//            Object o = JsonPath.read(jsonObject, path); // <------ this 
should produce InvalidPathException but was null
//            throw new AssertionError(format("Document contains the path <%s> 
but was expected not to.", path));
//        } catch (InvalidPathException e) {
//        }
//        return this;
//    }

Original issue reported on code.google.com by kent.cwg@gmail.com on 11 Nov 2013 at 2:16

GoogleCodeExporter commented 8 years ago
Fixed in 1.0

Original comment by kalle.st...@gmail.com on 12 Dec 2013 at 9:48

GoogleCodeExporter commented 8 years ago
Any plans to release 1.0 soon?

Original comment by frans.fl...@gmail.com on 7 May 2014 at 2:54

GoogleCodeExporter commented 8 years ago
Yes

Original comment by kalle.st...@gmail.com on 18 Sep 2014 at 5:41

GoogleCodeExporter commented 8 years ago

Original comment by kalle.st...@gmail.com on 1 Oct 2014 at 11:09