Search in sources :

Example 1 with ConfigurationService

use of org.graylog.plugins.sidecar.services.ConfigurationService in project graylog2-server by Graylog2.

the class ConfigurationServiceTest method setUp.

@Before
public void setUp() throws Exception {
    final ObjectMapper objectMapper = new ObjectMapperProvider().get();
    final MongoJackObjectMapperProvider mongoJackObjectMapperProvider = new MongoJackObjectMapperProvider(objectMapper);
    when(nodeDetails.operatingSystem()).thenReturn("DummyOS");
    when(nodeDetails.ip()).thenReturn("1.2.3.4");
    when(sidecar.nodeId()).thenReturn("42");
    when(sidecar.nodeName()).thenReturn("mockymock");
    when(sidecar.nodeDetails()).thenReturn(nodeDetails);
    this.configurationVariableService = new ConfigurationVariableService(mongodb.mongoConnection(), mongoJackObjectMapperProvider);
    this.configurationService = new ConfigurationService(mongodb.mongoConnection(), mongoJackObjectMapperProvider, configurationVariableService);
}
Also used : MongoJackObjectMapperProvider(org.graylog2.bindings.providers.MongoJackObjectMapperProvider) ConfigurationService(org.graylog.plugins.sidecar.services.ConfigurationService) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) MongoJackObjectMapperProvider(org.graylog2.bindings.providers.MongoJackObjectMapperProvider) ObjectMapperProvider(org.graylog2.shared.bindings.providers.ObjectMapperProvider) ConfigurationVariableService(org.graylog.plugins.sidecar.services.ConfigurationVariableService) Before(org.junit.Before)

Example 2 with ConfigurationService

use of org.graylog.plugins.sidecar.services.ConfigurationService in project graylog2-server by Graylog2.

the class SidecarCollectorConfigurationFacadeTest method setUp.

@Before
public void setUp() throws Exception {
    final MongoJackObjectMapperProvider mapperProvider = new MongoJackObjectMapperProvider(objectMapper);
    final ConfigurationService configurationService = new ConfigurationService(mongodb.mongoConnection(), mapperProvider, new ConfigurationVariableService(mongodb.mongoConnection(), mapperProvider));
    facade = new SidecarCollectorConfigurationFacade(objectMapper, configurationService);
}
Also used : MongoJackObjectMapperProvider(org.graylog2.bindings.providers.MongoJackObjectMapperProvider) ConfigurationService(org.graylog.plugins.sidecar.services.ConfigurationService) ConfigurationVariableService(org.graylog.plugins.sidecar.services.ConfigurationVariableService) Before(org.junit.Before)

Aggregations

ConfigurationService (org.graylog.plugins.sidecar.services.ConfigurationService)2 ConfigurationVariableService (org.graylog.plugins.sidecar.services.ConfigurationVariableService)2 MongoJackObjectMapperProvider (org.graylog2.bindings.providers.MongoJackObjectMapperProvider)2 Before (org.junit.Before)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ObjectMapperProvider (org.graylog2.shared.bindings.providers.ObjectMapperProvider)1