diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java index 05c723ad90586..0d6757bb71c16 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java @@ -300,8 +300,13 @@ void checkWarningHeaders(final List warningHeaders) { * This warning header will come back in the vast majority of our tests that create an index. Rather than rewrite our * tests to assert this warning header, we assume that it is expected. */ - } - else if (expected.remove(message) == false) { + } else // noinspection StatementWithEmptyBody + if (message.startsWith("[types removal]")) { + /* + * We skip warnings related to types deprecation so that we can continue to run the many + * mixed-version tests that used typed APIs. + */ + } else if (expected.remove(message) == false) { unexpected.add(header); } } else { diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java index 5a201c66aa1ce..b3fabf98a6390 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/DoSectionTests.java @@ -128,6 +128,16 @@ public void testWarningHeaders() { } } + public void testIgnoreTypesWarnings() { + String legitimateWarning = DeprecationLogger.formatWarning("warning"); + String typesWarning = DeprecationLogger.formatWarning("[types removal] " + + "The endpoint /{index}/{type}/_count is deprecated, use /{index}/_count instead."); + + DoSection section = new DoSection(new XContentLocation(1, 1)); + section.setExpectedWarningHeaders(singletonList("warning")); + section.checkWarningHeaders(Arrays.asList(legitimateWarning, typesWarning)); + } + public void testParseDoSectionNoBody() throws Exception { parser = createParser(YamlXContent.yamlXContent, "get:\n" +