diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedReverseNested.java b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedReverseNested.java index dec15c3eded10..fafed73370c00 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedReverseNested.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/bucket/nested/ParsedReverseNested.java @@ -23,7 +23,7 @@ import java.io.IOException; -public class ParsedReverseNested extends ParsedSingleBucketAggregation implements Nested { +public class ParsedReverseNested extends ParsedSingleBucketAggregation implements ReverseNested { @Override public String getType() { diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalNestedTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalNestedTests.java index a43e0dd519fab..039ef8fd12930 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalNestedTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalNestedTests.java @@ -22,9 +22,11 @@ import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalSingleBucketAggregationTestCase; +import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -49,4 +51,10 @@ protected Reader instanceReader() { protected Class implementationClass() { return ParsedNested.class; } + + @Override + protected void assertFromXContent(InternalNested aggregation, ParsedAggregation parsedAggregation) throws IOException { + super.assertFromXContent(aggregation, parsedAggregation); + assertTrue(parsedAggregation instanceof Nested); + } } diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalReverseNestedTests.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalReverseNestedTests.java index ddfe10b27eb32..6031d435adc2b 100644 --- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalReverseNestedTests.java +++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/nested/InternalReverseNestedTests.java @@ -22,9 +22,11 @@ import org.elasticsearch.common.io.stream.Writeable.Reader; import org.elasticsearch.search.aggregations.InternalAggregations; import org.elasticsearch.search.aggregations.InternalSingleBucketAggregationTestCase; +import org.elasticsearch.search.aggregations.ParsedAggregation; import org.elasticsearch.search.aggregations.bucket.ParsedSingleBucketAggregation; import org.elasticsearch.search.aggregations.pipeline.PipelineAggregator; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -49,4 +51,10 @@ protected Reader instanceReader() { protected Class implementationClass() { return ParsedReverseNested.class; } + + @Override + protected void assertFromXContent(InternalReverseNested aggregation, ParsedAggregation parsedAggregation) throws IOException { + super.assertFromXContent(aggregation, parsedAggregation); + assertTrue(parsedAggregation instanceof ReverseNested); + } }