use of org.graylog2.rest.resources.tools.responses.GrokTesterResponse in project graylog2-server by Graylog2.
the class GrokTesterResourceTest method testGrokWithEmptyTestString.
@Test
public void testGrokWithEmptyTestString() {
final GrokTesterResponse response = resource.grokTest("%{NUMBER}", "", false);
assertThat(response.matched()).isFalse();
assertThat(response.pattern()).isEqualTo("%{NUMBER}");
assertThat(response.string()).isEqualTo("");
assertThat(response.errorMessage()).isNullOrEmpty();
}
use of org.graylog2.rest.resources.tools.responses.GrokTesterResponse in project graylog2-server by Graylog2.
the class GrokTesterResourceTest method testGrokWithValidPatternAndNoMatch.
@Test
public void testGrokWithValidPatternAndNoMatch() {
final GrokTesterResponse response = resource.grokTest("%{NUMBER}", "abc def", false);
assertThat(response.matched()).isFalse();
assertThat(response.pattern()).isEqualTo("%{NUMBER}");
assertThat(response.string()).isEqualTo("abc def");
assertThat(response.matches()).isEmpty();
assertThat(response.errorMessage()).isNullOrEmpty();
}
Aggregations