use of com.lordofthejars.nosqlunit.annotation.UsingDataSet in project graylog2-server by Graylog2.
the class AbsoluteSearchResourceTest method searchForExistingKeyword.
@Test
@UsingDataSet(locations = "searchForExistingKeyword.json")
public void searchForExistingKeyword() {
final ValidatableResponse result = doSearchFor("Testmessage");
final JsonPath response = result.statusCode(200).extract().jsonPath();
assertThat(response.getInt("total_results")).isEqualTo(1);
assertThat(response.getList("messages")).hasSize(1);
assertThat(response.getList("used_indices")).hasSize(1);
}
use of com.lordofthejars.nosqlunit.annotation.UsingDataSet in project graylog2-server by Graylog2.
the class AbsoluteSearchResourceTest method searchForExistingKeywordInsideOfVeryNarrowTimeRange.
@Test
@UsingDataSet(locations = "searchForExistingKeyword.json")
public void searchForExistingKeywordInsideOfVeryNarrowTimeRange() {
final ValidatableResponse result = doSearchFor("Testmessage", "2015-06-16T11:32:16.827Z", "2015-06-16T11:32:16.827Z");
final JsonPath response = result.statusCode(200).extract().jsonPath();
assertThat(response.getInt("total_results")).isEqualTo(1);
assertThat(response.getList("messages")).isNotEmpty();
assertThat(response.getList("used_indices")).hasSize(1);
}
use of com.lordofthejars.nosqlunit.annotation.UsingDataSet in project graylog2-server by Graylog2.
the class IndicesGetAllMessageFieldsTest method GetAllMessageFieldsForIndicesForNonexistingIndexShouldReturnEmptySet.
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.DELETE_ALL)
public void GetAllMessageFieldsForIndicesForNonexistingIndexShouldReturnEmptySet() throws Exception {
final String[] indexNames = new String[] { "graylog_0" };
final IndicesExistsResponse response = client.admin().indices().exists(new IndicesExistsRequest("graylog_0")).get();
assertThat(response.isExists()).isFalse();
final Map<String, Set<String>> result = indices.getAllMessageFieldsForIndices(indexNames);
assertThat(result).isNotNull().isEmpty();
}
use of com.lordofthejars.nosqlunit.annotation.UsingDataSet in project graylog2-server by Graylog2.
the class IndicesTest method testAliasExists.
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.CLEAN_INSERT)
public void testAliasExists() throws Exception {
assertThat(indices.aliasExists("graylog_alias")).isFalse();
final IndicesAdminClient adminClient = client.admin().indices();
final IndicesAliasesRequest request = adminClient.prepareAliases().addAlias(INDEX_NAME, "graylog_alias").request();
final IndicesAliasesResponse response = adminClient.aliases(request).actionGet(ES_TIMEOUT);
assertThat(response.isAcknowledged()).isTrue();
assertThat(indices.aliasExists("graylog_alias")).isTrue();
}
use of com.lordofthejars.nosqlunit.annotation.UsingDataSet in project graylog2-server by Graylog2.
the class IndicesTest method indexCreationDateReturnsNullForNonExistingIndex.
@Test
@UsingDataSet(loadStrategy = LoadStrategyEnum.DELETE_ALL)
public void indexCreationDateReturnsNullForNonExistingIndex() {
final DateTime indexCreationDate = indices.indexCreationDate("index_missing");
assertThat(indexCreationDate).isNull();
}
Aggregations