Skip to content

Commit 050097c

Browse files
committed
Update test
1 parent 1b39089 commit 050097c

File tree

1 file changed

+7
-3
lines changed
  • server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket

1 file changed

+7
-3
lines changed

server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,15 +470,19 @@ public void testReverseNestedAggWithoutNestedAgg() {
470470
public void testNonExistingNestedField() throws Exception {
471471
assertNoFailuresAndResponse(
472472
prepareSearch("idx2").setQuery(matchAllQuery())
473-
.addAggregation(nested("nested2", "nested1.nested2").subAggregation(reverseNested("incorrect").path("nested3"))),
473+
.addAggregation(nested("nested2", "nested1.nested2"))
474+
.addAggregation(nested("incorrect", "nested1.incorrect")),
474475
response -> {
475476

476477
SingleBucketAggregation nested = response.getAggregations().get("nested2");
477478
assertThat(nested, notNullValue());
478479
assertThat(nested.getName(), equalTo("nested2"));
480+
assertThat(nested.getDocCount(), is(27L));
479481

480-
SingleBucketAggregation reverseNested = nested.getAggregations().get("incorrect");
481-
assertThat(reverseNested.getDocCount(), is(0L));
482+
SingleBucketAggregation incorrect = response.getAggregations().get("incorrect");
483+
assertThat(incorrect, notNullValue());
484+
assertThat(incorrect.getName(), equalTo("incorrect"));
485+
assertThat(incorrect.getDocCount(), is(0L));
482486
}
483487
);
484488

0 commit comments

Comments
 (0)