diff --git a/src/test/java/features/Test5AggsSelect.java b/src/test/java/features/Test5AggsSelect.java index aaa1cbe16597676dc0242043622322dd95b95fcc..f667a07e8e7e7e24fd4d14734b7e4c1dd356cfba 100644 --- a/src/test/java/features/Test5AggsSelect.java +++ b/src/test/java/features/Test5AggsSelect.java @@ -252,7 +252,7 @@ public class Test5AggsSelect { @Test public void test_histogram() throws Exception { - String tmp = + ONode oNode = context .indice(indice) .limit(0) @@ -263,26 +263,30 @@ public class Test5AggsSelect { h -> { h.interval(2).offset(1); })) - .selectJson(); + .selectAggs(); - System.out.println(tmp); + System.out.println(oNode.toJson()); + + assert (oNode.get("level_histogram").isObject()); } @Test public void test_date_histogram() throws Exception { - String tmp = - context - .indice(indice) - .limit(0) - .aggs( - a -> - a.dateHistogram( - "log_fulltime", - d -> { - d.calendarInterval("1s").format("yyyy-MM-dd HH:mm:ss"); - })) - .selectJson(); - System.out.println(tmp); + ONode oNode = context + .indice(indice) + .limit(0) + .aggs( + a -> + a.dateHistogram( + "log_fulltime", + d -> { + d.calendarInterval("1s").format("yyyy-MM-dd HH:mm:ss"); + })) + .selectAggs(); + + System.out.println(oNode.toJson()); + + assert (oNode.get("log_fulltime_date_histogram").isObject()); } }