Skip to content
This repository was archived by the owner on Mar 21, 2023. It is now read-only.

Commit 3fa6e5b

Browse files
author
Edmundo Alvarez
committed
Update evalError test rule
Since #32, the behaviour of `to_ip()` changed and now it doesn't raise an exception in those circumstances. Now we use `regex()` to throw an exception instead.
1 parent ca8d894 commit 3fa6e5b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/test/java/org/graylog/plugins/pipelineprocessor/functions/FunctionsSnippetsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public void evalError() {
332332

333333
assertThat(context).isNotNull();
334334
assertThat(context.hasEvaluationErrors()).isTrue();
335-
assertThat(Iterables.getLast(context.evaluationErrors()).toString()).isEqualTo("In call to function 'to_ip' at 5:28 an exception was thrown: 'null' is not an IP string literal.");
335+
assertThat(Iterables.getLast(context.evaluationErrors()).toString()).isEqualTo("In call to function 'regex' at 5:28 an exception was thrown: Argument 'value' cannot be 'null'");
336336
}
337337

338338
@Test

src/test/resources/org/graylog/plugins/pipelineprocessor/functions/evalError.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ rule "trigger null"
22
when
33
true
44
then
5-
set_field("this_is_null", to_ip($message.does_not_exist));
5+
set_field("do_not_exist", regex(".*", to_string($message.do_not_exist)).matches);
66
end

0 commit comments

Comments
 (0)