use of org.graylog2.indexer.EventIndexTemplateProvider in project graylog2-server by Graylog2.
the class EventsIndexMappingTest method createsValidMappingTemplates.
@ParameterizedTest
@ValueSource(strings = { "5.0.0", "6.0.0", "7.0.0" })
void createsValidMappingTemplates(String versionString) throws Exception {
final SearchVersion version = SearchVersion.elasticsearch(versionString);
final IndexMappingTemplate mapping = new EventIndexTemplateProvider().create(version, null);
assertJsonPath(mapping.toTemplate(indexSetConfig, "test_*"), at -> {
at.jsonPathAsString("$.index_patterns").isEqualTo("test_*");
at.jsonPathAsInteger("$.order").isEqualTo(-1);
assertStandardMappingValues(at, version);
});
assertJsonPath(mapping.toTemplate(indexSetConfig, "test_*", 23), at -> {
at.jsonPathAsString("$.index_patterns").isEqualTo("test_*");
at.jsonPathAsInteger("$.order").isEqualTo(23);
assertStandardMappingValues(at, version);
});
}
Aggregations