File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
json-path/src/test/java/com/jayway/jsonpath Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 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' ,
Original file line number Diff line number Diff line change 44import org .junit .runner .RunWith ;
55import org .junit .runners .Parameterized ;
66
7+ import java .math .BigDecimal ;
78import java .util .ArrayList ;
89import 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
You can’t perform that action at this time.
0 commit comments