use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendITBase method runWithExpectedResult.
protected void runWithExpectedResult(ExportMessagesCommand command, @SuppressWarnings("SameParameterValue") String resultFields, String... messageValues) {
SimpleMessageChunk totalResult = collectTotalResult(command);
assertResultMatches(resultFields, totalResult, messageValues, true);
}
use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendITBase method marksFirstChunk.
@Test
public void marksFirstChunk() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().build();
SimpleMessageChunk[] chunks = collectChunksFor(command).toArray(new SimpleMessageChunk[0]);
assertThat(chunks[0].isFirstChunk()).isTrue();
}
use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendITBase method respectsResultLimitIfSet.
@Test
public void respectsResultLimitIfSet() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().chunkSize(1).limit(3).build();
SimpleMessageChunk totalResult = collectTotalResult(command);
assertThat(totalResult.messages()).hasSize(3);
}
use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendITBase method runWithExpectedResultIgnoringSort.
protected void runWithExpectedResultIgnoringSort(ExportMessagesCommand command, String resultFields, String... messageValues) {
SimpleMessageChunk totalResult = collectTotalResult(command);
assertResultMatches(resultFields, totalResult, messageValues, false);
}
use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendITBase method usesTimeRangeTestLtEqualToTimestampofLastEntry.
// This method tests, that with LT (the upper interval excluded) instead of LTE the message with a TS same as the upper interval is excluded
@Test
public void usesTimeRangeTestLtEqualToTimestampofLastEntry() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().timeRange(timerange("2015-01-01T00:00:00.000Z", "2015-01-01T01:59:59.999Z")).build();
SimpleMessageChunk totalResult = collectTotalResult(command);
assertThat(totalResult.messages().stream().map(msg -> msg.fields().get("timestamp")).anyMatch("2015-01-01T01:00:00.000Z"::equals)).isTrue();
assertThat(totalResult.messages().stream().map(msg -> msg.fields().get("timestamp")).anyMatch("2015-01-01T01:59:59.999Z"::equals)).isFalse();
}
Aggregations