Add CoreValuesSourceTypeTests for histogram (#49751) (#49765)

This commit is contained in:
Ignacio Vera 2019-12-02 16:21:56 +01:00 committed by GitHub
parent ade72b97b7
commit ff00174b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,7 @@ public class CoreValuesSourceTypeTests extends AbstractWriteableEnumTestCase {
assertThat(CoreValuesSourceType.BYTES.ordinal(), equalTo(2));
assertThat(CoreValuesSourceType.GEOPOINT.ordinal(), equalTo(3));
assertThat(CoreValuesSourceType.RANGE.ordinal(), equalTo(4));
assertThat(CoreValuesSourceType.HISTOGRAM.ordinal(), equalTo(5));
}
@Override
@ -47,6 +48,7 @@ public class CoreValuesSourceTypeTests extends AbstractWriteableEnumTestCase {
assertThat(CoreValuesSourceType.fromString("bytes"), equalTo(CoreValuesSourceType.BYTES));
assertThat(CoreValuesSourceType.fromString("geopoint"), equalTo(CoreValuesSourceType.GEOPOINT));
assertThat(CoreValuesSourceType.fromString("range"), equalTo(CoreValuesSourceType.RANGE));
assertThat(CoreValuesSourceType.fromString("histogram"), equalTo(CoreValuesSourceType.HISTOGRAM));
IllegalArgumentException e = expectThrows(IllegalArgumentException.class,
() -> CoreValuesSourceType.fromString("does_not_exist"));
assertThat(e.getMessage(),
@ -61,6 +63,7 @@ public class CoreValuesSourceTypeTests extends AbstractWriteableEnumTestCase {
assertReadFromStream(2, CoreValuesSourceType.BYTES);
assertReadFromStream(3, CoreValuesSourceType.GEOPOINT);
assertReadFromStream(4, CoreValuesSourceType.RANGE);
assertReadFromStream(5, CoreValuesSourceType.HISTOGRAM);
}
@Override
@ -70,5 +73,6 @@ public class CoreValuesSourceTypeTests extends AbstractWriteableEnumTestCase {
assertWriteToStream(CoreValuesSourceType.BYTES, 2);
assertWriteToStream(CoreValuesSourceType.GEOPOINT, 3);
assertWriteToStream(CoreValuesSourceType.RANGE, 4);
assertWriteToStream(CoreValuesSourceType.HISTOGRAM, 5);
}
}