use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testSuccessfulMatch.
@Test
public void testSuccessfulMatch() {
StreamRule rule = getSampleRule();
rule.setValue("3");
Message msg = getSampleMessage();
msg.addField("something", "4");
StreamRuleMatcher matcher = getMatcher(rule);
assertTrue(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testSuccessfullInvertedMatchWithEqualValues.
@Test
public void testSuccessfullInvertedMatchWithEqualValues() {
StreamRule rule = getSampleRule();
rule.setValue("-9001");
rule.setInverted(true);
Message msg = getSampleMessage();
msg.addField("something", "-9001");
StreamRuleMatcher matcher = getMatcher(rule);
assertTrue(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method getSampleRule.
@Override
protected StreamRule getSampleRule() {
StreamRule rule = super.getSampleRule();
rule.setType(StreamRuleType.GREATER);
return rule;
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testSuccessfulMatchWithNegativeValue.
@Test
public void testSuccessfulMatchWithNegativeValue() {
StreamRule rule = getSampleRule();
rule.setValue("-54354");
Message msg = getSampleMessage();
msg.addField("something", "4");
StreamRuleMatcher matcher = getMatcher(rule);
assertTrue(matcher.match(msg, rule));
}
use of org.graylog2.plugin.streams.StreamRule in project graylog2-server by Graylog2.
the class GreaterMatcherTest method testMissedDoubleMatch.
@Test
public void testMissedDoubleMatch() {
StreamRule rule = getSampleRule();
rule.setValue("25");
Message msg = getSampleMessage();
msg.addField("something", "12.4");
StreamRuleMatcher matcher = getMatcher(rule);
assertFalse(matcher.match(msg, rule));
}
Aggregations