use of org.graylog2.lookup.LookupTable in project graylog2-server by Graylog2.
the class FunctionsSnippetsTest method lookupRemoveStringList.
@Test
public void lookupRemoveStringList() {
final ImmutableList<String> testList = ImmutableList.of("foo", "bar");
final ImmutableList<String> result = ImmutableList.of("bonk");
doReturn(LookupResult.withoutTTL().stringListValue(result).build()).when(lookupTable).removeStringList(any(), any());
final Rule rule = parser.parseRule(ruleForTest(), true);
final Message message = evaluateRule(rule);
verify(lookupTable).removeStringList("key", testList);
verifyNoMoreInteractions(lookupTable);
assertThat(message.getField("new_value")).isEqualTo(result);
}
Aggregations