Skip to content

Commit 8c6c002

Browse files
committed
Add missing test case
1 parent 140438c commit 8c6c002

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

x-pack/plugin/mapper-exponential-histogram/src/test/java/org/elasticsearch/xpack/exponentialhistogram/ExponentialHistogramFieldMapperTests.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,15 @@ protected List<ExampleMalformedValue> exampleMalformedValues() {
389389
.endArray()
390390
.endObject()
391391
.endObject()
392-
).errorMatches("has a total value count exceeding the allowed maximum value of " + Long.MAX_VALUE)
392+
).errorMatches("has a total value count exceeding the allowed maximum value of " + Long.MAX_VALUE),
393+
394+
// Non-Zero sum for empty histogram
395+
exampleMalformedValue(
396+
b -> b.startObject()
397+
.field("scale", 0)
398+
.field("sum", 42.0)
399+
.endObject()
400+
).errorMatches("sum field must be zero if the histogram is empty, but got 42.0")
393401
);
394402
}
395403

0 commit comments

Comments
 (0)