Search in sources :

Example 6 with ContainerMatrixTest

use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.

the class SearchMetadataIT method testRetrievingMetadataForStoredSearchWithParameter.

@ContainerMatrixTest
void testRetrievingMetadataForStoredSearchWithParameter() {
    final ValidatableResponse response = given().spec(requestSpec).when().get("/views/search/metadata/61977043c1f17d26b45c8a0a").then().statusCode(200);
    response.assertThat().body("query_metadata.f1446410-a082-4871-b3bf-d69aa42d0c96.used_parameters_names", contains("action"));
    response.assertThat().body("declared_parameters", anEmptyMap());
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) ContainerMatrixTest(org.graylog.testing.containermatrix.annotations.ContainerMatrixTest)

Example 7 with ContainerMatrixTest

use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.

the class SuggestionResourceIT method testSizeOtherDocsCount.

@ContainerMatrixTest
void testSizeOtherDocsCount() {
    final ValidatableResponse validatableResponse = given().spec(requestSpec).when().body("{\"field\":\"facility\", \"input\":\"\", \"size\":1}").post("/search/suggest").then().statusCode(200);
    validatableResponse.assertThat().body("suggestions.value[0]", equalTo("test"));
    validatableResponse.assertThat().body("suggestions.occurrence[0]", greaterThanOrEqualTo(2));
    validatableResponse.assertThat().body("sum_other_docs_count", greaterThanOrEqualTo(1));
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) ContainerMatrixTest(org.graylog.testing.containermatrix.annotations.ContainerMatrixTest)

Example 8 with ContainerMatrixTest

use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.

the class SuggestionResourceIT method testMinimalRequest.

@ContainerMatrixTest
void testMinimalRequest() {
    final ValidatableResponse validatableResponse = given().spec(requestSpec).when().body("{\"field\":\"facility\", \"input\":\"\"}").post("/search/suggest").then().statusCode(200);
    validatableResponse.assertThat().body("suggestions.value[0]", equalTo("test"));
    validatableResponse.assertThat().body("suggestions.occurrence[0]", greaterThanOrEqualTo(2));
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) ContainerMatrixTest(org.graylog.testing.containermatrix.annotations.ContainerMatrixTest)

Example 9 with ContainerMatrixTest

use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.

the class QueryValidationResourceIT method testMinimalisticRequest.

@ContainerMatrixTest
void testMinimalisticRequest() {
    final ValidatableResponse validatableResponse = given().spec(requestSpec).when().body("{\"query\":\"foo:bar\"}").post("/search/validate").then().statusCode(200);
    validatableResponse.assertThat().body("status", equalTo("WARNING"));
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) ContainerMatrixTest(org.graylog.testing.containermatrix.annotations.ContainerMatrixTest)

Example 10 with ContainerMatrixTest

use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.

the class QueryValidationResourceIT method testRegexWithoutFieldName.

@ContainerMatrixTest
void testRegexWithoutFieldName() {
    final ValidatableResponse validatableResponse = given().spec(requestSpec).when().body("{\"query\":\"/ethernet[0-9]+/\"}").post("/search/validate").then().statusCode(200);
    validatableResponse.assertThat().body("status", equalTo("OK"));
}
Also used : ValidatableResponse(io.restassured.response.ValidatableResponse) ContainerMatrixTest(org.graylog.testing.containermatrix.annotations.ContainerMatrixTest)

Aggregations

ContainerMatrixTest (org.graylog.testing.containermatrix.annotations.ContainerMatrixTest)23 ValidatableResponse (io.restassured.response.ValidatableResponse)14 IndexSet (org.graylog2.indexer.IndexSet)4 ZonedDateTime (java.time.ZonedDateTime)3 DateTime (org.joda.time.DateTime)3 BulkIndexRequest (org.graylog.testing.elasticsearch.BulkIndexRequest)2 TestIndexSet (org.graylog2.indexer.TestIndexSet)2 IndexRangeStats (org.graylog2.indexer.searches.IndexRangeStats)2 Response (io.restassured.response.Response)1 IndexNotFoundException (org.graylog2.indexer.IndexNotFoundException)1 IndexSetStatsCreator (org.graylog2.indexer.IndexSetStatsCreator)1 IndexSetStats (org.graylog2.rest.resources.system.indexer.responses.IndexSetStats)1 Order (org.junit.jupiter.api.Order)1 TestMethodOrder (org.junit.jupiter.api.TestMethodOrder)1