use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.
the class IndicesIT method retrievingIndexStatsForWildcard.
@ContainerMatrixTest
public void retrievingIndexStatsForWildcard() {
final IndexSetStatsCreator indexSetStatsCreator = new IndexSetStatsCreator(indices);
final String indexPrefix = "indices_wildcard_";
final String wildcard = indexPrefix + "*";
final IndexSet indexSet = mock(IndexSet.class);
when(indexSet.getIndexWildcard()).thenReturn(wildcard);
createRandomIndex(indexPrefix);
createRandomIndex(indexPrefix);
final IndexSetStats indexSetStats = indexSetStatsCreator.getForIndexSet(indexSet);
assertThat(indexSetStats.indices()).isEqualTo(2L);
assertThat(indexSetStats.size()).isNotZero();
}
use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.
the class IndicesIT method indexRangeStatsOfIndexReturnsMinMaxTimestampsForGivenIndex.
@ContainerMatrixTest
public void indexRangeStatsOfIndexReturnsMinMaxTimestampsForGivenIndex() {
importFixture("org/graylog2/indexer/indices/IndicesIT.json");
IndexRangeStats stats = indices.indexRangeStatsOfIndex(INDEX_NAME);
assertThat(stats.min()).isEqualTo(new DateTime(2015, 1, 1, 1, 0, DateTimeZone.UTC));
assertThat(stats.max()).isEqualTo(new DateTime(2015, 1, 1, 5, 0, DateTimeZone.UTC));
}
use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.
the class IndicesIT method indexRangeStatsWorksForEmptyIndex.
@ContainerMatrixTest
public void indexRangeStatsWorksForEmptyIndex() {
final String indexName = createRandomIndex("indices_it_");
IndexRangeStats stats = indices.indexRangeStatsOfIndex(indexName);
assertThat(stats.min()).isEqualTo(new DateTime(0L, DateTimeZone.UTC));
assertThat(stats.max()).isEqualTo(new DateTime(0L, DateTimeZone.UTC));
}
use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.
the class SearchMetadataIT method testMinimalRequestWithSingleParameter.
@ContainerMatrixTest
void testMinimalRequestWithSingleParameter() {
final ValidatableResponse response = given().spec(requestSpec).when().body(fixture("org/graylog/plugins/views/minimalistic-request-with-undeclared-parameter.json")).post("/views/search/metadata").then().statusCode(200);
response.assertThat().body("query_metadata.f1446410-a082-4871-b3bf-d69aa42d0c96.used_parameters_names", contains("action"));
response.assertThat().body("declared_parameters", anEmptyMap());
}
use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.
the class SearchMetadataIT method testMinimalRequestWithoutParameter.
@ContainerMatrixTest
void testMinimalRequestWithoutParameter() {
final ValidatableResponse response = given().spec(requestSpec).when().body(fixture("org/graylog/plugins/views/minimalistic-request.json")).post("/views/search/metadata").then().statusCode(200);
response.assertThat().body("query_metadata*.value.used_parameters_names[0]", empty());
response.assertThat().body("declared_parameters", anEmptyMap());
}
Aggregations