File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
json-path/src/test/java/com/jayway/jsonpath/internal/function Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1515 * Shows aggregation across fields rather than within a single entity.
1616 *
1717 */
18- public class Issue191 extends com . jayway . jsonpath . internal . function . BaseFunctionTest {
18+ public class Issue191 {
1919
2020 private Configuration conf = Configurations .GSON_CONFIGURATION ;
2121
2222 @ Test
2323 public void testResultSetNumericComputation () {
2424 InputStream stream = ClassLoader .getSystemResourceAsStream ("issue_191.json" );
25- Long value = JsonPath .parse (stream ).read ("$.max ($..timestamp)" , Long .class );
25+ Long value = JsonPath .parse (stream ).read ("$.sum ($..timestamp)" , Long .class );
2626 assertEquals ("Expected the max function to consume the aggregation parameters and calculate the max over the result set" ,
27- Long .valueOf (1427310341 ), value );
27+ Long .valueOf (35679716813L ), value );
28+ }
29+
30+ @ Test
31+ public void testMultipleResultSetSums () {
32+ InputStream stream = ClassLoader .getSystemResourceAsStream ("issue_191.json" );
33+ Long value = JsonPath .parse (stream ).read ("$.sum($..timestamp, $..cpus)" , Long .class );
34+ assertEquals ("Expected the max function to consume the aggregation parameters and calculate the max over the result set" ,
35+ Long .valueOf (35679716835L ), value );
2836 }
2937
3038 @ Test
You can’t perform that action at this time.
0 commit comments