Browse Source

adding an example with more than one replacement

pull/377/head
Greenwood 7 years ago
parent
commit
02c88d70e6
  1. 8
      json-path/src/test/java/com/jayway/jsonpath/internal/function/Issue191.java

8
json-path/src/test/java/com/jayway/jsonpath/internal/function/Issue191.java

@ -35,6 +35,14 @@ public class Issue191 {
Long.valueOf(35679716813L), value); Long.valueOf(35679716813L), value);
} }
@Test
public void testResultSetNumericComputationRecursiveReplacement() {
InputStream stream = ClassLoader.getSystemResourceAsStream("issue_191.json");
Long value = JsonPath.parse(stream).read("$.max($..timestamp.avg(), $..timestamp.stddev())", Long.class);
assertEquals("Expected the max function to consume the aggregation parameters and calculate the max over the result set",
Long.valueOf(1427188672L), value);
}
@Test @Test
public void testMultipleResultSetSums() { public void testMultipleResultSetSums() {
InputStream stream = ClassLoader.getSystemResourceAsStream("issue_191.json"); InputStream stream = ClassLoader.getSystemResourceAsStream("issue_191.json");

Loading…
Cancel
Save