use of org.graylog2.shared.bindings.providers.ObjectMapperProvider in project graylog2-server by Graylog2.
the class ViewServiceUsesViewRequirementsTest method setUp.
@Before
public void setUp() throws Exception {
final MongoJackObjectMapperProvider objectMapperProvider = new MongoJackObjectMapperProviderForTest(new ObjectMapper());
this.viewService = new ViewService(mongodb.mongoConnection(), objectMapperProvider, clusterConfigService, viewRequirementsFactory, mock(EntityOwnershipService.class), mock(ViewSummaryService.class));
when(viewRequirementsFactory.create(any(ViewDTO.class))).then(invocation -> new ViewRequirements(Collections.emptySet(), invocation.getArgument(0)));
}
use of org.graylog2.shared.bindings.providers.ObjectMapperProvider in project graylog2-server by Graylog2.
the class IndexFieldTypesServiceTest method setUp.
@Before
public void setUp() throws Exception {
final MongoJackObjectMapperProvider objectMapperProvider = new MongoJackObjectMapperProvider(new ObjectMapper());
final StreamService streamService = mock(StreamService.class);
this.dbService = new IndexFieldTypesService(mongodb.mongoConnection(), streamService, objectMapperProvider);
}
use of org.graylog2.shared.bindings.providers.ObjectMapperProvider in project graylog2-server by Graylog2.
the class ContentPackInstallationPersistenceServiceTest method setUp.
@Before
public void setUp() throws Exception {
final ObjectMapper objectMapper = new ObjectMapperProvider().get();
final MongoJackObjectMapperProvider mongoJackObjectMapperProvider = new MongoJackObjectMapperProvider(objectMapper);
persistenceService = new ContentPackInstallationPersistenceService(mongoJackObjectMapperProvider, mongodb.mongoConnection());
}
use of org.graylog2.shared.bindings.providers.ObjectMapperProvider in project graylog2-server by Graylog2.
the class DBJobDefinitionServiceTest method setUp.
@Before
public void setUp() throws Exception {
final ObjectMapper objectMapper = new ObjectMapperProvider().get();
objectMapper.registerSubtypes(new NamedType(TestEventProcessorConfig.class, TestEventProcessorConfig.TYPE_NAME));
objectMapper.registerSubtypes(new NamedType(TestEventProcessorParameters.class, TestEventProcessorParameters.TYPE_NAME));
objectMapper.registerSubtypes(new NamedType(EventProcessorExecutionJob.Config.class, EventProcessorExecutionJob.TYPE_NAME));
this.service = new DBJobDefinitionService(mongodb.mongoConnection(), new MongoJackObjectMapperProvider(objectMapper));
}
use of org.graylog2.shared.bindings.providers.ObjectMapperProvider in project graylog2-server by Graylog2.
the class V20170110150100_FixAlertConditionsMigrationTest method setUp.
@Before
public void setUp() throws Exception {
this.clusterConfigService = spy(new ClusterConfigServiceImpl(objectMapperProvider, mongodb.mongoConnection(), nodeId, new ChainingClassLoader(getClass().getClassLoader()), new ClusterEventBus()));
final MongoConnection mongoConnection = spy(mongodb.mongoConnection());
final MongoDatabase mongoDatabase = spy(mongoConnection.getMongoDatabase());
when(mongoConnection.getMongoDatabase()).thenReturn(mongoDatabase);
this.collection = spy(mongoDatabase.getCollection("streams"));
when(mongoDatabase.getCollection("streams")).thenReturn(collection);
this.migration = new V20170110150100_FixAlertConditionsMigration(mongoConnection, clusterConfigService);
}
Aggregations