Skip to content

Commit 8bae57f

Browse files
committed
Merge branch 'master' of github.com:json-path/JsonPath
2 parents edf52aa + 08830e9 commit 8bae57f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ext {
1919
hamcrest: 'org.hamcrest:hamcrest:2.2',
2020
jacksonDatabind: 'com.fasterxml.jackson.core:jackson-databind:2.14.2',
2121
jettison: 'org.codehaus.jettison:jettison:1.5.4',
22-
jsonOrg: 'org.json:json:20140107',
22+
jsonOrg: 'org.json:json:20230227',
2323
tapestryJson: 'org.apache.tapestry:tapestry-json:5.8.1',
2424
jakartaJsonP: 'jakarta.json:jakarta.json-api:2.0.1',
2525
jakartaJsonB: 'jakarta.json.bind:jakarta.json.bind-api:2.0.0',

json-path/src/test/java/com/jayway/jsonpath/InlineFilterTest.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.junit.runner.RunWith;
55
import org.junit.runners.Parameterized;
66

7+
import java.math.BigDecimal;
78
import java.util.ArrayList;
89
import java.util.List;
910

@@ -73,9 +74,14 @@ public static Iterable<Configuration> configurations() {
7374

7475
@Test
7576
public void root_context_can_be_referred_in_predicate() {
76-
List<Double> prices = using(conf).parse(JSON_DOCUMENT).read("store.book[?(@.display-price <= $.max-price)].display-price", List.class);
77+
List<?> prices = using(conf).parse(JSON_DOCUMENT).read("store.book[?(@.display-price <= $.max-price)].display-price", List.class);
7778

78-
assertThat(prices).containsAll(asList(8.95D, 8.99D));
79+
assertThat(prices.stream().map(this::asDouble)).containsAll(asList(8.95D, 8.99D));
80+
}
81+
82+
private Double asDouble(Object object) {
83+
// For json-org implementation returns a list of big decimals
84+
return object instanceof BigDecimal ? ((BigDecimal) object).doubleValue() : (Double) object;
7985
}
8086

8187
@Test

0 commit comments

Comments
 (0)