[TEST] add test to verify that no aggs have been forgotten in AggregationsTests
This commit is contained in:
parent
c5bdbecc64
commit
37dc165e7f
|
@ -58,6 +58,8 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.Collections.singletonMap;
|
||||
|
||||
|
@ -116,6 +118,14 @@ public class AggregationsTests extends ESTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
public void testAllAggsAreBeingTested() {
|
||||
assertEquals(InternalAggregationTestCase.getNamedXContents().size(), aggsTests.size());
|
||||
Set<String> aggs = aggsTests.stream().map((testCase) -> testCase.createTestInstance().getType()).collect(Collectors.toSet());
|
||||
for (NamedXContentRegistry.Entry entry : InternalAggregationTestCase.getNamedXContents()) {
|
||||
assertTrue(aggs.contains(entry.name.getPreferredName()));
|
||||
}
|
||||
}
|
||||
|
||||
public void testFromXContent() throws IOException {
|
||||
XContentType xContentType = randomFrom(XContentType.values());
|
||||
final ToXContent.Params params = new ToXContent.MapParams(singletonMap(RestSearchAction.TYPED_KEYS_PARAM, "true"));
|
||||
|
|
Loading…
Reference in New Issue