|
@@ -78,6 +78,12 @@ public class PercentilesTests extends BaseAggregationTestCase<PercentilesAggrega
|
|
|
assertEquals("percent must be in [0,100], got [104.0]: [testAgg]", ex.getMessage());
|
|
|
}
|
|
|
|
|
|
+ public void testDuplicatePercentilesThrows() throws IOException {
|
|
|
+ PercentilesAggregationBuilder builder = new PercentilesAggregationBuilder("testAgg");
|
|
|
+ IllegalArgumentException ex = expectThrows(IllegalArgumentException.class, () -> builder.percentiles(5, 42, 10, 99, 42, 87));
|
|
|
+ assertEquals("percent [42.0] has been specified twice: [testAgg]", ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
public void testExceptionMultipleMethods() throws IOException {
|
|
|
final String illegalAgg = "{\n" +
|
|
|
" \"percentiles\": {\n" +
|