Skip to content

Commit 35459cd

Browse files
authored
Support catching HTTP Gone (410) response codes in YAML REST tests (#98752)
As a follow up to #97397, we want the ability to assert on unavailable API endpoints that return a 410 status code. This PR adds this support to our YAML testing framework. cc @swallez
1 parent 4a69793 commit 35459cd

File tree

1 file changed

+3
-1
lines changed
  • test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section

1 file changed

+3
-1
lines changed

test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ private String formatStatusCodeMessage(ClientYamlTestResponse restTestResponse,
554554
Map.entry("missing", tuple("404", equalTo(404))),
555555
Map.entry("request_timeout", tuple("408", equalTo(408))),
556556
Map.entry("conflict", tuple("409", equalTo(409))),
557+
Map.entry("gone", tuple("410", equalTo(410))),
557558
Map.entry("unavailable", tuple("503", equalTo(503))),
558559
Map.entry(
559560
"request",
@@ -566,7 +567,8 @@ private String formatStatusCodeMessage(ClientYamlTestResponse restTestResponse,
566567
not(equalTo(403)),
567568
not(equalTo(404)),
568569
not(equalTo(408)),
569-
not(equalTo(409))
570+
not(equalTo(409)),
571+
not(equalTo(410))
570572
)
571573
)
572574
)

0 commit comments

Comments
 (0)