diff --git a/json-path/src/test/java/com/jayway/jsonpath/old/FilterTest.java b/json-path/src/test/java/com/jayway/jsonpath/old/FilterTest.java index 3d479e81..67bf405e 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/old/FilterTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/old/FilterTest.java @@ -60,15 +60,10 @@ public class FilterTest extends BaseTest { " }\n" + "}"; - private static final JsonProvider jp = new JsonSmartJsonProvider(); - private static final Configuration conf = Configuration.defaultConfiguration(); - //------------------------------------------------- - // - // Single filter tests - // - //------------------------------------------------- - @Test + + private static final JsonProvider jp = conf.jsonProvider(); + public void is_filters_evaluates() throws Exception { final Map check = new HashMap(); check.put("foo", "foo"); @@ -380,7 +375,7 @@ public class FilterTest extends BaseTest { @Test public void filters_can_contain_json_path_expressions() throws Exception { - Object doc = new JsonSmartJsonProvider().parse(DOCUMENT); + Object doc = Configuration.defaultConfiguration().jsonProvider().parse(DOCUMENT); assertFalse(filter(where("$.store.bicycle.color").ne("red")).apply(createPredicateContext(doc))); } @@ -410,7 +405,7 @@ public class FilterTest extends BaseTest { "}\n"; - Object doc = new JsonSmartJsonProvider().parse(json); + Object doc = Configuration.defaultConfiguration().jsonProvider().parse(json); List> result = JsonPath.read(doc, "$.fields[?]", filter(where("errors").notEmpty())); assertEquals(1, result.size()); diff --git a/json-path/src/test/java/com/jayway/jsonpath/old/IssuesTest.java b/json-path/src/test/java/com/jayway/jsonpath/old/IssuesTest.java index add764c2..e74e1ee9 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/old/IssuesTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/old/IssuesTest.java @@ -28,7 +28,7 @@ import static org.junit.Assert.assertThat; public class IssuesTest { - private static final JsonProvider jp = new JsonSmartJsonProvider(); + private static final JsonProvider jp = Configuration.defaultConfiguration().jsonProvider(); @Test public void full_ones_can_be_filtered() { diff --git a/json-path/src/test/java/com/jayway/jsonpath/old/internal/PredicatePathTokenTest.java b/json-path/src/test/java/com/jayway/jsonpath/old/internal/PredicatePathTokenTest.java index abfafa77..383759e6 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/old/internal/PredicatePathTokenTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/old/internal/PredicatePathTokenTest.java @@ -1,5 +1,6 @@ package com.jayway.jsonpath.old.internal; +import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.internal.spi.json.JsonSmartJsonProvider; import org.junit.Test; @@ -13,32 +14,32 @@ import static org.assertj.core.api.Assertions.entry; public class PredicatePathTokenTest { - private static final Object ARRAY = new JsonSmartJsonProvider().parse( + private static final Object ARRAY = Configuration.defaultConfiguration().jsonProvider().parse( "[" + - "{\n" + - " \"foo\" : \"foo-val-0\"\n" + - "}," + - "{\n" + - " \"foo\" : \"foo-val-1\"\n" + - "}," + - "{\n" + - " \"foo\" : \"foo-val-2\"\n" + - "}," + - "{\n" + - " \"foo\" : \"foo-val-3\"\n" + - "}," + - "{\n" + - " \"foo\" : \"foo-val-4\"\n" + - "}," + - "{\n" + - " \"foo\" : \"foo-val-5\"\n" + - "}," + - "{\n" + - " \"foo\" : \"foo-val-6\"\n" + - "}" + - "]"); - - private static Object ARRAY2 = new JsonSmartJsonProvider().parse( + "{\n" + + " \"foo\" : \"foo-val-0\"\n" + + "}," + + "{\n" + + " \"foo\" : \"foo-val-1\"\n" + + "}," + + "{\n" + + " \"foo\" : \"foo-val-2\"\n" + + "}," + + "{\n" + + " \"foo\" : \"foo-val-3\"\n" + + "}," + + "{\n" + + " \"foo\" : \"foo-val-4\"\n" + + "}," + + "{\n" + + " \"foo\" : \"foo-val-5\"\n" + + "}," + + "{\n" + + " \"foo\" : \"foo-val-6\"\n" + + "}" + + "]"); + + private static Object ARRAY2 = Configuration.defaultConfiguration().jsonProvider().parse( "[" + "{\n" + " \"foo\" : \"foo-val-0\",\n" + diff --git a/json-path/src/test/java/com/jayway/jsonpath/old/internal/ScanPathTokenTest.java b/json-path/src/test/java/com/jayway/jsonpath/old/internal/ScanPathTokenTest.java index b42e3dd4..febe4d09 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/old/internal/ScanPathTokenTest.java +++ b/json-path/src/test/java/com/jayway/jsonpath/old/internal/ScanPathTokenTest.java @@ -15,7 +15,7 @@ import static org.assertj.core.api.Assertions.assertThat; public class ScanPathTokenTest { - public final static Object DOCUMENT = new JsonSmartJsonProvider().parse( + public final static Object DOCUMENT = Configuration.defaultConfiguration().jsonProvider().parse( "{\n" + " \"store\":{\n" + " \"book\":[\n" + @@ -64,7 +64,7 @@ public class ScanPathTokenTest { "}" ); - public final static Object DOCUMENT2 = new JsonSmartJsonProvider().parse( + public final static Object DOCUMENT2 = Configuration.defaultConfiguration().jsonProvider().parse( "{\n" + " \"firstName\": \"John\",\n" + " \"lastName\" : \"doe\",\n" + diff --git a/json-path/src/test/java/com/jayway/jsonpath/old/internal/TestBase.java b/json-path/src/test/java/com/jayway/jsonpath/old/internal/TestBase.java index c28e3864..a740b82c 100644 --- a/json-path/src/test/java/com/jayway/jsonpath/old/internal/TestBase.java +++ b/json-path/src/test/java/com/jayway/jsonpath/old/internal/TestBase.java @@ -9,7 +9,7 @@ import com.jayway.jsonpath.internal.spi.json.JsonSmartJsonProvider; public class TestBase { - public final static Object ARRAY = new JsonSmartJsonProvider().parse("[" + + public final static Object ARRAY = Configuration.defaultConfiguration().jsonProvider().parse("[" + "{\n" + " \"foo\" : \"foo-val-0\"\n" + "}," + @@ -33,7 +33,7 @@ public class TestBase { "}" + "]"); - public final static Object DOC = new JsonSmartJsonProvider().parse( + public final static Object DOC = Configuration.defaultConfiguration().jsonProvider().parse( "{ \"store\": {\n" + " \"book\": [ \n" + " { \"category\": \"reference\",\n" +