|
|
|
@ -54,6 +54,18 @@ public class JsonModelTest {
|
|
|
|
|
" }\n" + |
|
|
|
|
"}"; |
|
|
|
|
|
|
|
|
|
public final static String INVALID_DOCUMENT = "{?\\?\\?!!?~q`}}}}}\"\" \"store\": {\n"; |
|
|
|
|
|
|
|
|
|
@Test(expected = InvalidJsonException.class) |
|
|
|
|
public void invalid_json_throws() throws Exception { |
|
|
|
|
JsonModel.model(INVALID_DOCUMENT).get("store.id"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test(expected = InvalidPathException.class) |
|
|
|
|
public void invalid_path_throws() throws Exception { |
|
|
|
|
JsonModel.model(DOCUMENT).get("a("); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void a_model_can_be_pretty_printed() throws Exception { |
|
|
|
@ -84,7 +96,6 @@ public class JsonModelTest {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void maps_and_list_can_queried() throws Exception { |
|
|
|
|
Map<String, Object> doc = new HashMap<String, Object>(); |
|
|
|
@ -99,10 +110,6 @@ public class JsonModelTest {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test(expected = InvalidPathException.class) |
|
|
|
|
public void invalid_path_throws() throws Exception { |
|
|
|
|
JsonModel.model(DOCUMENT).get("store.invalid"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void query_for_null_property_returns_null() { |
|
|
|
|