Skip to content

Commit

Permalink
Update evalError test rule
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Edmundo Alvarez committed Jul 20, 2016
1 parent ca8d894 commit 3fa6e5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public void evalError() {

assertThat(context).isNotNull();
assertThat(context.hasEvaluationErrors()).isTrue();
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.");
assertThat(Iterables.getLast(context.evaluationErrors()).toString()).isEqualTo("In call to function 'regex' at 5:28 an exception was thrown: Argument 'value' cannot be 'null'");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ rule "trigger null"
when
true
then
set_field("this_is_null", to_ip($message.does_not_exist));
set_field("do_not_exist", regex(".*", to_string($message.do_not_exist)).matches);
end

0 comments on commit 3fa6e5b

Please sign in to comment.