@@ -73,22 +73,20 @@ public void testIndexExists() throws IOException {
73
73
headTestCase ("/test" , singletonMap ("pretty" , "true" ), greaterThan (0 ));
74
74
}
75
75
76
- @ Override
77
- protected boolean getStrictDeprecationMode () {
78
- // Remove this override when we remove the reference to types below
79
- return false ;
80
- }
81
-
82
76
public void testTypeExists () throws IOException {
83
77
createTestDoc ();
84
- headTestCase ("/test/_mapping/_doc" , emptyMap (), greaterThan (0 ));
85
- headTestCase ("/test/_mapping/_doc" , singletonMap ("pretty" , "true" ), greaterThan (0 ));
78
+ headTestCase ("/test/_mapping/_doc" , emptyMap (), OK .getStatus (), greaterThan (0 ),
79
+ "Type exists requests are deprecated, as types have been deprecated." );
80
+ headTestCase ("/test/_mapping/_doc" , singletonMap ("pretty" , "true" ), OK .getStatus (), greaterThan (0 ),
81
+ "Type exists requests are deprecated, as types have been deprecated." );
86
82
}
87
83
88
84
public void testTypeDoesNotExist () throws IOException {
89
85
createTestDoc ();
90
- headTestCase ("/test/_mapping/does-not-exist" , emptyMap (), NOT_FOUND .getStatus (), greaterThan (0 ));
91
- headTestCase ("/text/_mapping/_doc,does-not-exist" , emptyMap (), NOT_FOUND .getStatus (), greaterThan (0 ));
86
+ headTestCase ("/test/_mapping/does-not-exist" , emptyMap (), NOT_FOUND .getStatus (), greaterThan (0 ),
87
+ "Type exists requests are deprecated, as types have been deprecated." );
88
+ headTestCase ("/text/_mapping/test,does-not-exist" , emptyMap (), NOT_FOUND .getStatus (), greaterThan (0 ),
89
+ "Type exists requests are deprecated, as types have been deprecated." );
92
90
}
93
91
94
92
public void testAliasExists () throws IOException {
@@ -193,11 +191,13 @@ private void headTestCase(
193
191
final String url ,
194
192
final Map <String , String > params ,
195
193
final int expectedStatusCode ,
196
- final Matcher <Integer > matcher ) throws IOException {
194
+ final Matcher <Integer > matcher ,
195
+ final String ... expectedWarnings ) throws IOException {
197
196
Request request = new Request ("HEAD" , url );
198
197
for (Map .Entry <String , String > param : params .entrySet ()) {
199
198
request .addParameter (param .getKey (), param .getValue ());
200
199
}
200
+ request .setOptions (expectWarnings (expectedWarnings ));
201
201
Response response = client ().performRequest (request );
202
202
assertEquals (expectedStatusCode , response .getStatusLine ().getStatusCode ());
203
203
assertThat (Integer .valueOf (response .getHeader ("Content-Length" )), matcher );
0 commit comments