From 36eacfb3c3cf5e56e6c845ce7ab98190f4b3d915 Mon Sep 17 00:00:00 2001 From: psysane Date: Mon, 11 Jun 2018 21:25:53 +0530 Subject: [PATCH] Update json data --- .../src/main/resources/online_store.json | 42 ++++++++++--------- .../introduction/JsonPathUnitTest.java | 2 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/json-path/src/main/resources/online_store.json b/json-path/src/main/resources/online_store.json index d8e2402b25..c0ddf274d8 100644 --- a/json-path/src/main/resources/online_store.json +++ b/json-path/src/main/resources/online_store.json @@ -1,21 +1,23 @@ { - "items": { - "book": [ - { - "author": "Arthur Conan Doyle", - "title": "Sherlock Holmes", - "price": 8.99 - }, - { - "author": "J. R. R. Tolkien", - "title": "The Lord of the Rings", - "isbn": "0-395-19395-8", - "price": 22.99 - } - ], - "bicycle": { - "color": "red", - "price": 19.95 - } - } -} + "items":{ + "book":[ + { + "author":"Arthur Conan Doyle", + "title":"Sherlock Holmes", + "price":8.99 + }, + { + "author":"J. R. R. Tolkien", + "title":"The Lord of the Rings", + "isbn":"0-395-19395-8", + "price":22.99 + } + ], + "bicycle":{ + "color":"red", + "price":19.95 + } + }, + "url":"mystore.com", + "owner":"baeldung" +} \ No newline at end of file diff --git a/json-path/src/test/java/com/baeldung/jsonpath/introduction/JsonPathUnitTest.java b/json-path/src/test/java/com/baeldung/jsonpath/introduction/JsonPathUnitTest.java index 6b780c9c10..3408629a6d 100644 --- a/json-path/src/test/java/com/baeldung/jsonpath/introduction/JsonPathUnitTest.java +++ b/json-path/src/test/java/com/baeldung/jsonpath/introduction/JsonPathUnitTest.java @@ -33,7 +33,7 @@ public class JsonPathUnitTest { @Test public void shouldMatchCountOfObjects() { Map objectMap = JsonPath.read(json, "$"); - assertEquals(1, objectMap.keySet() + assertEquals(3, objectMap.keySet() .size()); }