use of org.graylog2.alarmcallbacks.AlarmCallbackConfigurationService in project graylog2-server by Graylog2.
the class V20161125142400_EmailAlarmCallbackMigrationTest method setUp.
@Before
public void setUp() throws Exception {
final User localAdmin = mock(User.class);
when(localAdmin.getId()).thenReturn(localAdminId);
when(userService.getAdminUser()).thenReturn(localAdmin);
this.emailAlarmCallbackMigrationPeriodical = new V20161125142400_EmailAlarmCallbackMigration(clusterConfigService, streamService, alarmCallbackConfigurationService, emailAlarmCallback, userService);
}
use of org.graylog2.alarmcallbacks.AlarmCallbackConfigurationService in project graylog2-server by Graylog2.
the class StreamCatalogTest method setUp.
@Before
@SuppressForbidden("Using Executors.newSingleThreadExecutor() is okay in tests")
public void setUp() throws Exception {
final MongoConnection mongoConnection = mongodb.mongoConnection();
final ClusterEventBus clusterEventBus = new ClusterEventBus("cluster-event-bus", Executors.newSingleThreadExecutor());
final StreamRuleService streamRuleService = new StreamRuleServiceImpl(mongoConnection, clusterEventBus);
final StreamService streamService = new StreamServiceImpl(mongoConnection, streamRuleService, alertService, outputService, indexSetService, mongoIndexSetFactory, notificationService, entityOwnershipService, clusterEventBus, alarmCallbackConfigurationService);
when(outputService.load("5adf239e4b900a0fdb4e5197")).thenReturn(OutputImpl.create("5adf239e4b900a0fdb4e5197", "Title", "Type", "admin", Collections.emptyMap(), new Date(1524654085L), null));
facade = new StreamFacade(objectMapper, streamService, streamRuleService, alertService, alarmCallbackConfigurationService, legacyAlertConditionMigration, indexSetService, userService);
}
use of org.graylog2.alarmcallbacks.AlarmCallbackConfigurationService in project graylog2-server by Graylog2.
the class ContentPackServiceTest method setUp.
@Before
public void setUp() throws Exception {
final ContentPackInstallationPersistenceService contentPackInstallationPersistenceService = contentPackInstallService;
final Set<ConstraintChecker> constraintCheckers = Collections.emptySet();
pluginMetaData = new HashSet<>();
outputFactories = new HashMap<>();
outputFactories2 = new HashMap<>();
final Map<ModelType, EntityWithExcerptFacade<?, ?>> entityFacades = ImmutableMap.of(ModelTypes.GROK_PATTERN_V1, new GrokPatternFacade(objectMapper, patternService), ModelTypes.STREAM_V1, new StreamFacade(objectMapper, streamService, streamRuleService, alertService, alarmCallbackConfigurationService, legacyAlertConditionMigration, indexSetService, userService), ModelTypes.OUTPUT_V1, new OutputFacade(objectMapper, outputService, pluginMetaData, outputFactories, outputFactories2));
contentPackService = new ContentPackService(contentPackInstallationPersistenceService, constraintCheckers, entityFacades);
Map<String, String> entityData = new HashMap<>(2);
entityData.put("name", "NAME");
entityData.put("pattern", "\\w");
grokPattern = GrokPattern.builder().pattern("\\w").name("NAME").build();
JsonNode jsonData = objectMapper.convertValue(entityData, JsonNode.class);
EntityV1 entityV1 = EntityV1.builder().id(ModelId.of("12345")).type(ModelTypes.GROK_PATTERN_V1).data(jsonData).build();
ImmutableSet<Entity> entities = ImmutableSet.of(entityV1);
NativeEntityDescriptor nativeEntityDescriptor = NativeEntityDescriptor.create(ModelId.of("12345"), "dead-beef1", ModelTypes.GROK_PATTERN_V1, "NAME");
nativeEntityDescriptors = ImmutableSet.of(nativeEntityDescriptor);
contentPack = ContentPackV1.builder().description("test").entities(entities).name("test").revision(1).summary("").vendor("").url(URI.create("http://graylog.com")).id(ModelId.of("dead-beef")).build();
contentPackInstallation = ContentPackInstallation.builder().contentPackId(ModelId.of("dead-beef")).contentPackRevision(1).entities(nativeEntityDescriptors).comment("Installed").parameters(ImmutableMap.copyOf(Collections.emptyMap())).createdAt(Instant.now()).createdBy("me").build();
}
use of org.graylog2.alarmcallbacks.AlarmCallbackConfigurationService in project graylog2-server by Graylog2.
the class V20161125161400_AlertReceiversMigrationTest method setUp.
@Before
@SuppressWarnings("deprecation")
public void setUp() throws Exception {
final MongoConnection mongoConnection = mock(MongoConnection.class);
final DB database = mock(DB.class);
when(mongoConnection.getDatabase()).thenReturn(database);
when(database.getCollection(eq("streams"))).thenReturn(dbCollection);
this.alertReceiversMigration = new V20161125161400_AlertReceiversMigration(clusterConfigService, streamService, alarmCallbackConfigurationService, mongoConnection);
}
Aggregations