Search in sources :

Example 1 with MessageIndexTemplateProvider

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());
}
Also used : NodeAdapter(org.graylog2.indexer.cluster.NodeAdapter) NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) IndexMappingFactory(org.graylog2.indexer.IndexMappingFactory) Node(org.graylog2.indexer.cluster.Node) MessageIndexTemplateProvider(org.graylog2.indexer.MessageIndexTemplateProvider) EventBus(com.google.common.eventbus.EventBus) Before(org.junit.Before)

Example 2 with MessageIndexTemplateProvider

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");
}
Also used : NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) TestIndexSet(org.graylog2.indexer.TestIndexSet) IndexMappingFactory(org.graylog2.indexer.IndexMappingFactory) Node(org.graylog2.indexer.cluster.Node) MetricRegistry(com.codahale.metrics.MetricRegistry) NodeId(org.graylog2.plugin.system.NodeId) Indices(org.graylog2.indexer.indices.Indices) MessageIndexTemplateProvider(org.graylog2.indexer.MessageIndexTemplateProvider) EventBus(com.google.common.eventbus.EventBus) Before(org.junit.Before)

Example 3 with MessageIndexTemplateProvider

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);
}
Also used : SearchVersion(org.graylog2.storage.SearchVersion) ValueSource(org.junit.jupiter.params.provider.ValueSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 4 with MessageIndexTemplateProvider

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());
}
Also used : NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) IndexMappingFactory(org.graylog2.indexer.IndexMappingFactory) Node(org.graylog2.indexer.cluster.Node) MessageIndexTemplateProvider(org.graylog2.indexer.MessageIndexTemplateProvider) EventBus(com.google.common.eventbus.EventBus) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

EventBus (com.google.common.eventbus.EventBus)3 NullAuditEventSender (org.graylog2.audit.NullAuditEventSender)3 IndexMappingFactory (org.graylog2.indexer.IndexMappingFactory)3 MessageIndexTemplateProvider (org.graylog2.indexer.MessageIndexTemplateProvider)3 Node (org.graylog2.indexer.cluster.Node)3 Before (org.junit.Before)2 MetricRegistry (com.codahale.metrics.MetricRegistry)1 TestIndexSet (org.graylog2.indexer.TestIndexSet)1 NodeAdapter (org.graylog2.indexer.cluster.NodeAdapter)1 Indices (org.graylog2.indexer.indices.Indices)1 NodeId (org.graylog2.plugin.system.NodeId)1 SearchVersion (org.graylog2.storage.SearchVersion)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 ValueSource (org.junit.jupiter.params.provider.ValueSource)1