use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.
the class QueryValidationResourceIT method testLowercaseNotOperator.
@ContainerMatrixTest
void testLowercaseNotOperator() {
final ValidatableResponse validatableResponse = given().spec(requestSpec).when().body("{\"query\":\"not(http_response_code:200)\"}").post("/search/validate").then().statusCode(200);
validatableResponse.assertThat().body("status", equalTo("WARNING"));
validatableResponse.assertThat().body("explanations.error_message[0]", containsString("Query contains invalid operator \"not\". All AND / OR / NOT operators have to be written uppercase"));
}
use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.
the class QueryValidationResourceIT method testOrQuery.
@ContainerMatrixTest
void testOrQuery() {
final ValidatableResponse validatableResponse = given().spec(requestSpec).when().body("{\"query\":\"unknown_field:(x OR y)\"}").post("/search/validate").then().statusCode(200);
validatableResponse.assertThat().body("status", equalTo("WARNING"));
validatableResponse.assertThat().body("explanations.error_message[0]", containsString("Query contains unknown field: unknown_field"));
}
use of org.graylog.testing.containermatrix.annotations.ContainerMatrixTest in project graylog2-server by Graylog2.
the class QueryValidationResourceIT method testInvalidQuery.
@ContainerMatrixTest
void testInvalidQuery() {
final ValidatableResponse validatableResponse = given().spec(requestSpec).when().body("{\"query\":\"foo:\"}").post("/search/validate").then().statusCode(200);
validatableResponse.assertThat().body("status", equalTo("ERROR"));
validatableResponse.assertThat().body("explanations.error_message[0]", containsString("Cannot parse query, cause: incomplete query, query ended unexpectedly"));
}
Aggregations