use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class SmallerMatcherTest method testMissedMatchWithMissingField.
@Test
public void testMissedMatchWithMissingField() {
StreamRule rule = getSampleRule();
rule.setValue("42");
Message msg = getSampleMessage();
msg.addField("someother", "23");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class SmallerMatcherTest method testSuccessfulMatchWithNegativeValue.
@Test
public void testSuccessfulMatchWithNegativeValue() {
StreamRule rule = getSampleRule();
rule.setValue("-54354");
Message msg = getSampleMessage();
msg.addField("something", "-90000");
StreamRuleMatcher matcher = getMatcher(rule);
assertTrue(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class SmallerMatcherTest method testMissedMatchWithEqualValues.
@Test
public void testMissedMatchWithEqualValues() {
StreamRule rule = getSampleRule();
rule.setValue("-9001");
Message msg = getSampleMessage();
msg.addField("something", "-9001");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class SmallerMatcherTest method testMissedDoubleMatchWithInvalidValue.
@Test
public void testMissedDoubleMatchWithInvalidValue() {
StreamRule rule = getSampleRule();
rule.setValue("LOL I AM NOT EVEN A NUMBER");
Message msg = getSampleMessage();
msg.addField("something", "-9001.42");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class SmallerMatcherTest method testMissedMatch.
@Test
public void testMissedMatch() {
StreamRule rule = getSampleRule();
rule.setValue("25");
Message msg = getSampleMessage();
msg.addField("something", "27");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
Aggregations