From ab555e0a33d533a708e8e6d78a8e48d797f339ff Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 10 Sep 2014 14:45:31 +0200 Subject: [PATCH] Test: Added more assertions --- .../search/aggregations/bucket/ChildrenTests.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/search/aggregations/bucket/ChildrenTests.java b/src/test/java/org/elasticsearch/search/aggregations/bucket/ChildrenTests.java index 43b78e083e861..ff873e2e6e559 100644 --- a/src/test/java/org/elasticsearch/search/aggregations/bucket/ChildrenTests.java +++ b/src/test/java/org/elasticsearch/search/aggregations/bucket/ChildrenTests.java @@ -170,7 +170,7 @@ public void testParentWithMultipleBuckets() throws Exception { TopHits topHits = childrenBucket.getAggregations().get("top_comments"); logger.info("total_hits={}", topHits.getHits().getTotalHits()); for (SearchHit searchHit : topHits.getHits()) { - logger.info("hit= {} {}", searchHit.sortValues()[0], searchHit.getId()); + logger.info("hit= {} {} {}", searchHit.sortValues()[0], searchHit.getType(), searchHit.getId()); } } @@ -185,8 +185,10 @@ public void testParentWithMultipleBuckets() throws Exception { assertThat(topHits.getHits().totalHits(), equalTo(2l)); assertThat(topHits.getHits().getAt(0).sortValues()[0].toString(), equalTo("a")); assertThat(topHits.getHits().getAt(0).getId(), equalTo("a")); + assertThat(topHits.getHits().getAt(0).getType(), equalTo("comment")); assertThat(topHits.getHits().getAt(1).sortValues()[0].toString(), equalTo("c")); assertThat(topHits.getHits().getAt(1).getId(), equalTo("c")); + assertThat(topHits.getHits().getAt(1).getType(), equalTo("comment")); categoryBucket = categoryTerms.getBucketByKey("b"); assertThat(categoryBucket.getKey(), equalTo("b")); @@ -198,6 +200,7 @@ public void testParentWithMultipleBuckets() throws Exception { topHits = childrenBucket.getAggregations().get("top_comments"); assertThat(topHits.getHits().totalHits(), equalTo(1l)); assertThat(topHits.getHits().getAt(0).getId(), equalTo("c")); + assertThat(topHits.getHits().getAt(0).getType(), equalTo("comment")); categoryBucket = categoryTerms.getBucketByKey("c"); assertThat(categoryBucket.getKey(), equalTo("c")); @@ -209,6 +212,7 @@ public void testParentWithMultipleBuckets() throws Exception { topHits = childrenBucket.getAggregations().get("top_comments"); assertThat(topHits.getHits().totalHits(), equalTo(1l)); assertThat(topHits.getHits().getAt(0).getId(), equalTo("c")); + assertThat(topHits.getHits().getAt(0).getType(), equalTo("comment")); } private static final class Control {