From 4014ffec4bcf08b53e8a593ed1016ef928f2c30c Mon Sep 17 00:00:00 2001 From: dblock Date: Mon, 16 Dec 2024 17:35:47 -0500 Subject: [PATCH] Added tests for /_validate/query. Signed-off-by: dblock --- tests/default/_core/validate/query.yaml | 17 +++++++++++++++++ tests/default/indices/validate/query.yaml | 23 +++++------------------ 2 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 tests/default/_core/validate/query.yaml diff --git a/tests/default/_core/validate/query.yaml b/tests/default/_core/validate/query.yaml new file mode 100644 index 000000000..1c5849c01 --- /dev/null +++ b/tests/default/_core/validate/query.yaml @@ -0,0 +1,17 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml + +description: Test validating queries. +chapters: + - synopsis: Validate a query. + path: /_validate/query + method: + - GET + - POST + request: + payload: + query: + match_all: {} + response: + status: 200 + payload: + valid: true diff --git a/tests/default/indices/validate/query.yaml b/tests/default/indices/validate/query.yaml index 264579058..55ced1fb8 100644 --- a/tests/default/indices/validate/query.yaml +++ b/tests/default/indices/validate/query.yaml @@ -1,6 +1,6 @@ $schema: ../../../../json_schemas/test_story.schema.yaml -description: Test validating queries for a specific index using both GET and POST methods. +description: Test validating queries for a specific index. epilogues: - path: /movies method: DELETE @@ -18,9 +18,11 @@ prologues: - {create: {_index: movies, _id: movie2}} - {director: Nicolas Winding Refn, title: Drive, year: 1960} chapters: - - synopsis: Validate a match query (GET). + - synopsis: Validate a match query. path: /{index}/_validate/query - method: GET + method: + - GET + - POST parameters: index: movies request: @@ -32,18 +34,3 @@ chapters: status: 200 payload: valid: true - - - synopsis: Validate a match query (POST). - path: /{index}/_validate/query - method: POST - parameters: - index: movies - request: - payload: - query: - match: - title: Drive - response: - status: 200 - payload: - valid: true \ No newline at end of file