File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
main/java/org/elasticsearch/test/rest/yaml/section
test/java/org/elasticsearch/test/rest/yaml/section Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -300,8 +300,13 @@ void checkWarningHeaders(final List<String> warningHeaders) {
300300 * This warning header will come back in the vast majority of our tests that create an index. Rather than rewrite our
301301 * tests to assert this warning header, we assume that it is expected.
302302 */
303- }
304- else if (expected .remove (message ) == false ) {
303+ } else // noinspection StatementWithEmptyBody
304+ if (message .startsWith ("[types removal]" )) {
305+ /*
306+ * We skip warnings related to types deprecation so that we can continue to run the many
307+ * mixed-version tests that used typed APIs.
308+ */
309+ } else if (expected .remove (message ) == false ) {
305310 unexpected .add (header );
306311 }
307312 } else {
Original file line number Diff line number Diff line change @@ -128,6 +128,16 @@ public void testWarningHeaders() {
128128 }
129129 }
130130
131+ public void testIgnoreTypesWarnings () {
132+ String legitimateWarning = DeprecationLogger .formatWarning ("warning" );
133+ String typesWarning = DeprecationLogger .formatWarning ("[types removal] " +
134+ "The endpoint /{index}/{type}/_count is deprecated, use /{index}/_count instead." );
135+
136+ DoSection section = new DoSection (new XContentLocation (1 , 1 ));
137+ section .setExpectedWarningHeaders (singletonList ("warning" ));
138+ section .checkWarningHeaders (Arrays .asList (legitimateWarning , typesWarning ));
139+ }
140+
131141 public void testParseDoSectionNoBody () throws Exception {
132142 parser = createParser (YamlXContent .yamlXContent ,
133143 "get:\n " +
You can’t perform that action at this time.
0 commit comments