use of org.graylog2.inputs.InputService in project graylog2-server by Graylog2.
the class StaticFieldFilterTest method testFilterIsNotOverwritingExistingKeys.
@Test
@SuppressForbidden("Executors#newSingleThreadExecutor() is okay for tests")
public void testFilterIsNotOverwritingExistingKeys() throws Exception {
Message msg = new Message("hello", "junit", Tools.nowUTC());
msg.addField("foo", "IWILLSURVIVE");
final StaticFieldFilter filter = new StaticFieldFilter(inputService, new EventBus(), Executors.newSingleThreadScheduledExecutor());
filter.filter(msg);
assertEquals("hello", msg.getMessage());
assertEquals("junit", msg.getSource());
assertEquals("IWILLSURVIVE", msg.getField("foo"));
}
Aggregations