File tree 2 files changed +9
-3
lines changed
json-path/src/test/java/com/jayway/jsonpath
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 19
19
hamcrest : ' org.hamcrest:hamcrest:2.2' ,
20
20
jacksonDatabind : ' com.fasterxml.jackson.core:jackson-databind:2.14.2' ,
21
21
jettison : ' org.codehaus.jettison:jettison:1.5.4' ,
22
- jsonOrg : ' org.json:json:20140107 ' ,
22
+ jsonOrg : ' org.json:json:20230227 ' ,
23
23
tapestryJson : ' org.apache.tapestry:tapestry-json:5.8.1' ,
24
24
jakartaJsonP : ' jakarta.json:jakarta.json-api:2.0.1' ,
25
25
jakartaJsonB : ' jakarta.json.bind:jakarta.json.bind-api:2.0.0' ,
Original file line number Diff line number Diff line change 4
4
import org .junit .runner .RunWith ;
5
5
import org .junit .runners .Parameterized ;
6
6
7
+ import java .math .BigDecimal ;
7
8
import java .util .ArrayList ;
8
9
import java .util .List ;
9
10
@@ -73,9 +74,14 @@ public static Iterable<Configuration> configurations() {
73
74
74
75
@ Test
75
76
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 );
77
78
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 ;
79
85
}
80
86
81
87
@ Test
You can’t perform that action at this time.
0 commit comments