Browse Source

Upgrade org.json:json from 20140107 to 20230227 (#907)

* Upgrade org.json:json from 20140107 to 20230227

* Remove unused import
pull/902/merge
Oswaldo Baptista Vicente Junior 2 years ago committed by GitHub
parent
commit
08830e92f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      build.gradle
  2. 10
      json-path/src/test/java/com/jayway/jsonpath/InlineFilterTest.java

2
build.gradle

@ -19,7 +19,7 @@ ext {
hamcrest: 'org.hamcrest:hamcrest:2.2',
jacksonDatabind: 'com.fasterxml.jackson.core:jackson-databind:2.14.2',
jettison: 'org.codehaus.jettison:jettison:1.5.4',
jsonOrg: 'org.json:json:20140107',
jsonOrg: 'org.json:json:20230227',
tapestryJson: 'org.apache.tapestry:tapestry-json:5.8.1',
jakartaJsonP: 'jakarta.json:jakarta.json-api:2.0.1',
jakartaJsonB: 'jakarta.json.bind:jakarta.json.bind-api:2.0.0',

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

@ -4,6 +4,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@ -73,9 +74,14 @@ public class InlineFilterTest extends BaseTest {
@Test
public void root_context_can_be_referred_in_predicate() {
List<Double> prices = using(conf).parse(JSON_DOCUMENT).read("store.book[?(@.display-price <= $.max-price)].display-price", List.class);
List<?> prices = using(conf).parse(JSON_DOCUMENT).read("store.book[?(@.display-price <= $.max-price)].display-price", List.class);
assertThat(prices).containsAll(asList(8.95D, 8.99D));
assertThat(prices.stream().map(this::asDouble)).containsAll(asList(8.95D, 8.99D));
}
private Double asDouble(Object object) {
// For json-org implementation returns a list of big decimals
return object instanceof BigDecimal ? ((BigDecimal) object).doubleValue() : (Double) object;
}
@Test

Loading…
Cancel
Save