|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.jayway.jsonassert; |
|
|
|
|
|
|
|
|
|
import org.hamcrest.Matchers; |
|
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
import static com.jayway.jsonassert.JsonAssert.*; |
|
|
|
@ -91,4 +92,14 @@ public class JsonAssertTest {
|
|
|
|
|
.assertThat("$.store.book[0].title", equalTo("Sayings of the Century")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void no_hit_returns_null() throws Exception { |
|
|
|
|
with(JSON).assertThat("$.store.book[1000].title", Matchers.<Object>nullValue()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void invalid_path() throws Exception { |
|
|
|
|
with(JSON).assertThat("$.store.book[*].fooBar", emptyCollection()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|