Search in sources :

Example 1 with JobSchedulerClock

use of org.graylog.scheduler.clock.JobSchedulerClock in project graylog2-server by Graylog2.

the class EventDefinitionFacadeTest method setUp.

@Before
@SuppressForbidden("Using Executors.newSingleThreadExecutor() is okay in tests")
public void setUp() throws Exception {
    objectMapper.registerSubtypes(AggregationEventProcessorConfig.class, PersistToStreamsStorageHandler.Config.class, TemplateFieldValueProvider.Config.class, AggregationEventProcessorConfigEntity.class);
    stateService = mock(DBEventProcessorStateService.class);
    jobDefinitionService = mock(DBJobDefinitionService.class);
    jobTriggerService = mock(DBJobTriggerService.class);
    jobSchedulerClock = mock(JobSchedulerClock.class);
    eventDefinitionService = new DBEventDefinitionService(mongodb.mongoConnection(), mapperProvider, stateService, entityOwnershipService);
    eventDefinitionHandler = new EventDefinitionHandler(eventDefinitionService, jobDefinitionService, jobTriggerService, jobSchedulerClock);
    Set<PluginMetaData> pluginMetaData = new HashSet<>();
    facade = new EventDefinitionFacade(objectMapper, eventDefinitionHandler, pluginMetaData, jobDefinitionService, eventDefinitionService, userService);
}
Also used : PersistToStreamsStorageHandler(org.graylog.events.processor.storage.PersistToStreamsStorageHandler) TemplateFieldValueProvider(org.graylog.events.fields.providers.TemplateFieldValueProvider) DBJobTriggerService(org.graylog.scheduler.DBJobTriggerService) JobSchedulerClock(org.graylog.scheduler.clock.JobSchedulerClock) PluginMetaData(org.graylog2.plugin.PluginMetaData) DBJobDefinitionService(org.graylog.scheduler.DBJobDefinitionService) DBEventDefinitionService(org.graylog.events.processor.DBEventDefinitionService) EventDefinitionHandler(org.graylog.events.processor.EventDefinitionHandler) DBEventProcessorStateService(org.graylog.events.processor.DBEventProcessorStateService) HashSet(java.util.HashSet) Before(org.junit.Before) SuppressForbidden(org.graylog2.shared.SuppressForbidden)

Aggregations

HashSet (java.util.HashSet)1 TemplateFieldValueProvider (org.graylog.events.fields.providers.TemplateFieldValueProvider)1 DBEventDefinitionService (org.graylog.events.processor.DBEventDefinitionService)1 DBEventProcessorStateService (org.graylog.events.processor.DBEventProcessorStateService)1 EventDefinitionHandler (org.graylog.events.processor.EventDefinitionHandler)1 PersistToStreamsStorageHandler (org.graylog.events.processor.storage.PersistToStreamsStorageHandler)1 DBJobDefinitionService (org.graylog.scheduler.DBJobDefinitionService)1 DBJobTriggerService (org.graylog.scheduler.DBJobTriggerService)1 JobSchedulerClock (org.graylog.scheduler.clock.JobSchedulerClock)1 PluginMetaData (org.graylog2.plugin.PluginMetaData)1 SuppressForbidden (org.graylog2.shared.SuppressForbidden)1 Before (org.junit.Before)1