Search in sources :

Example 1 with ClusterConfigServiceImpl

use of org.graylog2.cluster.ClusterConfigServiceImpl in project graylog2-server by Graylog2.

the class V20161215163900_MoveIndexSetDefaultConfigTest method setUp.

@Before
public void setUp() throws Exception {
    this.clusterConfigService = spy(new ClusterConfigServiceImpl(objectMapperProvider, fongoRule.getConnection(), nodeId, new ChainingClassLoader(getClass().getClassLoader()), new ClusterEventBus()));
    this.collection = fongoRule.getDatabase().getCollection("index_sets");
    this.migration = new V20161215163900_MoveIndexSetDefaultConfig(fongoRule.getConnection(), clusterConfigService);
}
Also used : ClusterConfigServiceImpl(org.graylog2.cluster.ClusterConfigServiceImpl) ChainingClassLoader(org.graylog2.shared.plugins.ChainingClassLoader) ClusterEventBus(org.graylog2.events.ClusterEventBus) Before(org.junit.Before)

Example 2 with ClusterConfigServiceImpl

use of org.graylog2.cluster.ClusterConfigServiceImpl in project graylog2-server by Graylog2.

the class ClusterConfigServiceImplTest method setUpService.

@Before
public void setUpService() throws Exception {
    DateTimeUtils.setCurrentMillisFixed(TIME.getMillis());
    this.mongoConnection = mongoRule.getMongoConnection();
    MongoJackObjectMapperProvider provider = new MongoJackObjectMapperProvider(objectMapper);
    when(nodeId.toString()).thenReturn("ID");
    this.clusterConfigService = new ClusterConfigServiceImpl(provider, mongoRule.getMongoConnection(), nodeId, new ChainingClassLoader(getClass().getClassLoader()), clusterEventBus);
}
Also used : MongoJackObjectMapperProvider(org.graylog2.bindings.providers.MongoJackObjectMapperProvider) ChainingClassLoader(org.graylog2.shared.plugins.ChainingClassLoader) Before(org.junit.Before)

Example 3 with ClusterConfigServiceImpl

use of org.graylog2.cluster.ClusterConfigServiceImpl in project graylog2-server by Graylog2.

the class V20170110150100_FixAlertConditionsMigrationTest method setUp.

@Before
public void setUp() throws Exception {
    this.clusterConfigService = spy(new ClusterConfigServiceImpl(objectMapperProvider, fongoRule.getConnection(), nodeId, new ChainingClassLoader(getClass().getClassLoader()), new ClusterEventBus()));
    final MongoConnection mongoConnection = spy(fongoRule.getConnection());
    final MongoDatabase mongoDatabase = spy(fongoRule.getDatabase());
    when(mongoConnection.getMongoDatabase()).thenReturn(mongoDatabase);
    this.collection = spy(mongoDatabase.getCollection("streams"));
    when(mongoDatabase.getCollection("streams")).thenReturn(collection);
    this.migration = new V20170110150100_FixAlertConditionsMigration(mongoConnection, clusterConfigService);
}
Also used : ClusterConfigServiceImpl(org.graylog2.cluster.ClusterConfigServiceImpl) MongoConnection(org.graylog2.database.MongoConnection) ChainingClassLoader(org.graylog2.shared.plugins.ChainingClassLoader) ClusterEventBus(org.graylog2.events.ClusterEventBus) MongoDatabase(com.mongodb.client.MongoDatabase) Before(org.junit.Before)

Example 4 with ClusterConfigServiceImpl

use of org.graylog2.cluster.ClusterConfigServiceImpl in project graylog2-server by Graylog2.

the class MongoIndexSetServiceTest method setUp.

@Before
public void setUp() throws Exception {
    clusterEventBus = new ClusterEventBus();
    clusterConfigService = new ClusterConfigServiceImpl(objectMapperProvider, mongoRule.getMongoConnection(), nodeId, new ChainingClassLoader(getClass().getClassLoader()), clusterEventBus);
    indexSetService = new MongoIndexSetService(mongoRule.getMongoConnection(), objectMapperProvider, streamService, clusterConfigService, clusterEventBus);
}
Also used : ClusterConfigServiceImpl(org.graylog2.cluster.ClusterConfigServiceImpl) ClusterEventBus(org.graylog2.events.ClusterEventBus) ChainingClassLoader(org.graylog2.shared.plugins.ChainingClassLoader) Before(org.junit.Before)

Aggregations

ChainingClassLoader (org.graylog2.shared.plugins.ChainingClassLoader)4 Before (org.junit.Before)4 ClusterConfigServiceImpl (org.graylog2.cluster.ClusterConfigServiceImpl)3 ClusterEventBus (org.graylog2.events.ClusterEventBus)3 MongoDatabase (com.mongodb.client.MongoDatabase)1 MongoJackObjectMapperProvider (org.graylog2.bindings.providers.MongoJackObjectMapperProvider)1 MongoConnection (org.graylog2.database.MongoConnection)1