8
8
9
9
package org .elasticsearch .cluster .metadata ;
10
10
11
+ import org .apache .logging .log4j .Level ;
11
12
import org .elasticsearch .Version ;
12
13
import org .elasticsearch .action .DocWriteRequest ;
13
14
import org .elasticsearch .action .IndicesRequest ;
@@ -2308,8 +2309,12 @@ public void testFullWildcardSystemIndexResolutionDeprecated() {
2308
2309
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2309
2310
assertThat (indexNames , containsInAnyOrder ("some-other-index" , ".ml-stuff" , ".ml-meta" , ".watches" ));
2310
2311
assertWarnings (
2311
- "this request accesses system indices: [.ml-meta, .ml-stuff, .watches], but in a future major version, "
2312
- + "direct access to system indices will be prevented by default"
2312
+ true ,
2313
+ new DeprecationWarning (
2314
+ Level .WARN ,
2315
+ "this request accesses system indices: [.ml-meta, .ml-stuff, .watches], "
2316
+ + "but in a future major version, direct access to system indices will be prevented by default"
2317
+ )
2313
2318
);
2314
2319
2315
2320
}
@@ -2322,10 +2327,13 @@ public void testSingleSystemIndexResolutionDeprecated() {
2322
2327
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2323
2328
assertThat (indexNames , containsInAnyOrder (".ml-meta" ));
2324
2329
assertWarnings (
2325
- "this request accesses system indices: [.ml-meta], but in a future major version, direct access "
2326
- + "to system indices will be prevented by default"
2330
+ true ,
2331
+ new DeprecationWarning (
2332
+ Level .WARN ,
2333
+ "this request accesses system indices: [.ml-meta], "
2334
+ + "but in a future major version, direct access to system indices will be prevented by default"
2335
+ )
2327
2336
);
2328
-
2329
2337
}
2330
2338
2331
2339
public void testWildcardSystemIndexReslutionSingleMatchDeprecated () {
@@ -2336,8 +2344,12 @@ public void testWildcardSystemIndexReslutionSingleMatchDeprecated() {
2336
2344
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2337
2345
assertThat (indexNames , containsInAnyOrder (".watches" ));
2338
2346
assertWarnings (
2339
- "this request accesses system indices: [.watches], but in a future major version, direct access "
2340
- + "to system indices will be prevented by default"
2347
+ true ,
2348
+ new DeprecationWarning (
2349
+ Level .WARN ,
2350
+ "this request accesses system indices: [.watches], "
2351
+ + "but in a future major version, direct access to system indices will be prevented by default"
2352
+ )
2341
2353
);
2342
2354
2343
2355
}
@@ -2350,8 +2362,12 @@ public void testWildcardSystemIndexResolutionMultipleMatchesDeprecated() {
2350
2362
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2351
2363
assertThat (indexNames , containsInAnyOrder (".ml-meta" , ".ml-stuff" ));
2352
2364
assertWarnings (
2353
- "this request accesses system indices: [.ml-meta, .ml-stuff], but in a future major version, direct access "
2354
- + "to system indices will be prevented by default"
2365
+ true ,
2366
+ new DeprecationWarning (
2367
+ Level .WARN ,
2368
+ "this request accesses system indices: [.ml-meta, .ml-stuff], "
2369
+ + "but in a future major version, direct access to system indices will be prevented by default"
2370
+ )
2355
2371
);
2356
2372
2357
2373
}
@@ -2405,8 +2421,12 @@ public void testExternalSystemIndexAccess() {
2405
2421
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2406
2422
assertThat (indexNames , contains (".external-sys-idx" ));
2407
2423
assertWarnings (
2408
- "this request accesses system indices: [.external-sys-idx], but in a future major version, direct access "
2409
- + "to system indices will be prevented by default"
2424
+ true ,
2425
+ new DeprecationWarning (
2426
+ Level .WARN ,
2427
+ "this request accesses system indices: [.external-sys-idx], "
2428
+ + "but in a future major version, direct access to system indices will be prevented by default"
2429
+ )
2410
2430
);
2411
2431
}
2412
2432
}
@@ -2418,8 +2438,12 @@ public void testExternalSystemIndexAccess() {
2418
2438
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2419
2439
assertThat (indexNames , contains (".external-sys-idx" ));
2420
2440
assertWarnings (
2421
- "this request accesses system indices: [.external-sys-idx], but in a future major version, direct access "
2422
- + "to system indices will be prevented by default"
2441
+ true ,
2442
+ new DeprecationWarning (
2443
+ Level .WARN ,
2444
+ "this request accesses system indices: [.external-sys-idx], "
2445
+ + "but in a future major version, direct access to system indices will be prevented by default"
2446
+ )
2423
2447
);
2424
2448
}
2425
2449
}
0 commit comments