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
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) {
300
300
* This warning header will come back in the vast majority of our tests that create an index. Rather than rewrite our
301
301
* tests to assert this warning header, we assume that it is expected.
302
302
*/
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 ) {
305
310
unexpected .add (header );
306
311
}
307
312
} else {
Original file line number Diff line number Diff line change @@ -128,6 +128,16 @@ public void testWarningHeaders() {
128
128
}
129
129
}
130
130
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
+
131
141
public void testParseDoSectionNoBody () throws Exception {
132
142
parser = createParser (YamlXContent .yamlXContent ,
133
143
"get:\n " +
You can’t perform that action at this time.
0 commit comments