Skip to content

Commit 02c88d7

Browse files
author
Greenwood
committed
adding an example with more than one replacement
1 parent a2936eb commit 02c88d7

File tree

1 file changed

+8
-0
lines changed
  • json-path/src/test/java/com/jayway/jsonpath/internal/function

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ public void testResultSetNumericComputationTail() {
3535
Long.valueOf(35679716813L), value);
3636
}
3737

38+
@Test
39+
public void testResultSetNumericComputationRecursiveReplacement() {
40+
InputStream stream = ClassLoader.getSystemResourceAsStream("issue_191.json");
41+
Long value = JsonPath.parse(stream).read("$.max($..timestamp.avg(), $..timestamp.stddev())", Long.class);
42+
assertEquals("Expected the max function to consume the aggregation parameters and calculate the max over the result set",
43+
Long.valueOf(1427188672L), value);
44+
}
45+
3846
@Test
3947
public void testMultipleResultSetSums() {
4048
InputStream stream = ClassLoader.getSystemResourceAsStream("issue_191.json");

0 commit comments

Comments
 (0)