use of org.graylog2.indexer.MessageIndexTemplateProvider in project graylog2-server by Graylog2.
the class IndicesGetAllMessageFieldsIT method setUp.
@Before
public void setUp() throws Exception {
final Node node = new Node(mock(NodeAdapter.class));
// noinspection UnstableApiUsage
indices = new Indices(new IndexMappingFactory(node, ImmutableMap.of(MESSAGE_TEMPLATE_TYPE, new MessageIndexTemplateProvider())), mock(NodeId.class), new NullAuditEventSender(), new EventBus(), indicesAdapter());
}
use of org.graylog2.indexer.MessageIndexTemplateProvider in project graylog2-server by Graylog2.
the class IndexFieldTypePollerIT method setUp.
@Before
public void setUp() throws Exception {
final Node node = mock(Node.class);
@SuppressWarnings("UnstableApiUsage") final Indices indices = new Indices(new IndexMappingFactory(node, ImmutableMap.of(MESSAGE_TEMPLATE_TYPE, new MessageIndexTemplateProvider())), mock(NodeId.class), new NullAuditEventSender(), mock(EventBus.class), createIndicesAdapter());
poller = new IndexFieldTypePoller(indices, new MetricRegistry(), createIndexFieldTypePollerAdapter());
indexSet = new TestIndexSet(indexSetConfig);
importFixture("org/graylog2/indexer/fieldtypes/IndexFieldTypePollerIT.json");
}
use of org.graylog2.indexer.MessageIndexTemplateProvider in project graylog2-server by Graylog2.
the class IndexMappingTest 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 MessageIndexTemplateProvider().create(version, null);
final Map<String, Object> template = mapping.toTemplate(indexSetConfig, "sampleIndexTemplate");
final String fixture = fixtureFor(version);
JSONAssert.assertEquals(json(template), fixture, true);
}
use of org.graylog2.indexer.MessageIndexTemplateProvider in project graylog2-server by Graylog2.
the class IndicesIT method setUp.
@BeforeEach
public void setUp() {
// noinspection UnstableApiUsage
eventBus = new EventBus("indices-test");
final Node node = new Node(createNodeAdapter());
final IndexMappingFactory indexMappingFactory = new IndexMappingFactory(node, ImmutableMap.of(MessageIndexTemplateProvider.MESSAGE_TEMPLATE_TYPE, new MessageIndexTemplateProvider()));
indices = new Indices(indexMappingFactory, mock(NodeId.class), new NullAuditEventSender(), eventBus, indicesAdapter());
}
Aggregations