use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendIT 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 ElasticsearchExportBackendIT 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 ElasticsearchExportBackendIT 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 ElasticsearchExportBackendIT method resultsHaveAllMessageFields.
@Test
public void resultsHaveAllMessageFields() {
importFixture("messages.json");
ExportMessagesCommand command = commandBuilderWithAllStreams().fieldsInOrder("timestamp", "message").build();
LinkedHashSet<SimpleMessageChunk> allChunks = collectChunksFor(command);
SimpleMessageChunk totalResult = allChunks.iterator().next();
Set<String> allFieldsInResult = actualFieldNamesFrom(totalResult);
assertThat(allFieldsInResult).containsExactlyInAnyOrder("gl2_message_id", "source", "message", "timestamp", "streams", "_id");
}
use of org.graylog.plugins.views.search.export.SimpleMessageChunk in project graylog2-server by Graylog2.
the class ElasticsearchExportBackendIT method runWithExpectedResult.
protected void runWithExpectedResult(ExportMessagesCommand command, @SuppressWarnings("SameParameterValue") String resultFields, String... messageValues) {
SimpleMessageChunk totalResult = collectTotalResult(command);
assertResultMatches(resultFields, totalResult, messageValues, true);
}
Aggregations