Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ buildscript {

ext {
libs = [
gson: 'com.google.code.gson:gson:2.8.5',
hamcrest: 'org.hamcrest:hamcrest:2.1',
jacksonDatabind: 'com.fasterxml.jackson.core:jackson-databind:2.9.8',
jettison: 'org.codehaus.jettison:jettison:1.3.7',
gson: 'com.google.code.gson:gson:2.8.6',
hamcrest: 'org.hamcrest:hamcrest:2.2',
jacksonDatabind: 'com.fasterxml.jackson.core:jackson-databind:2.11.3',
jettison: 'org.codehaus.jettison:jettison:1.4.1',
jsonOrg: 'org.json:json:20140107',
jsonSmart: 'net.minidev:json-smart:2.3',
slf4jApi: 'org.slf4j:slf4j-api:1.7.26',
tapestryJson: 'org.apache.tapestry:tapestry-json:5.4.4',
slf4jApi: 'org.slf4j:slf4j-api:1.7.30',
tapestryJson: 'org.apache.tapestry:tapestry-json:5.6.1',

test: [
'commons-io:commons-io:2.4',
'commons-io:commons-io:2.8.0',
'junit:junit:4.12',
'org.assertj:assertj-core:3.11.1',
'org.hamcrest:hamcrest:2.1',
'org.slf4j:slf4j-simple:1.7.26'
'org.assertj:assertj-core:3.18.1',
'org.hamcrest:hamcrest:2.2',
'org.slf4j:slf4j-simple:1.7.30'
]
]
snapshotVersion = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import static com.jayway.jsonpath.JsonPath.using;
Expand Down Expand Up @@ -145,9 +146,11 @@ public void an_Integer_can_be_converted_to_a_Double() {
@Test
public void list_of_numbers() {
JsonArray objs = using(GSON_CONFIGURATION).parse(JSON_DOCUMENT).read("$.store.book[*].display-price");

assertThat(objs.iterator()).extracting("asDouble").containsExactly(8.95D, 12.99D, 8.99D, 22.99D);

List<Double> actual = new ArrayList<>();
for (JsonElement obj : objs) {
actual.add(obj.getAsDouble());
}
assertThat(actual).containsExactly(8.95D, 12.99D, 8.99D, 22.99D);
}

@Test
Expand Down