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 ;
@@ -2306,8 +2307,12 @@ public void testFullWildcardSystemIndexResolutionDeprecated() {
2306
2307
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2307
2308
assertThat (indexNames , containsInAnyOrder ("some-other-index" , ".ml-stuff" , ".ml-meta" , ".watches" ));
2308
2309
assertWarnings (
2309
- "this request accesses system indices: [.ml-meta, .ml-stuff, .watches], but in a future major version, "
2310
- + "direct access to system indices will be prevented by default"
2310
+ true ,
2311
+ new DeprecationWarning (
2312
+ Level .WARN ,
2313
+ "this request accesses system indices: [.ml-meta, .ml-stuff, .watches], "
2314
+ + "but in a future major version, direct access to system indices will be prevented by default"
2315
+ )
2311
2316
);
2312
2317
2313
2318
}
@@ -2320,10 +2325,13 @@ public void testSingleSystemIndexResolutionDeprecated() {
2320
2325
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2321
2326
assertThat (indexNames , containsInAnyOrder (".ml-meta" ));
2322
2327
assertWarnings (
2323
- "this request accesses system indices: [.ml-meta], but in a future major version, direct access "
2324
- + "to system indices will be prevented by default"
2328
+ true ,
2329
+ new DeprecationWarning (
2330
+ Level .WARN ,
2331
+ "this request accesses system indices: [.ml-meta], "
2332
+ + "but in a future major version, direct access to system indices will be prevented by default"
2333
+ )
2325
2334
);
2326
-
2327
2335
}
2328
2336
2329
2337
public void testWildcardSystemIndexReslutionSingleMatchDeprecated () {
@@ -2334,8 +2342,12 @@ public void testWildcardSystemIndexReslutionSingleMatchDeprecated() {
2334
2342
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2335
2343
assertThat (indexNames , containsInAnyOrder (".watches" ));
2336
2344
assertWarnings (
2337
- "this request accesses system indices: [.watches], but in a future major version, direct access "
2338
- + "to system indices will be prevented by default"
2345
+ true ,
2346
+ new DeprecationWarning (
2347
+ Level .WARN ,
2348
+ "this request accesses system indices: [.watches], "
2349
+ + "but in a future major version, direct access to system indices will be prevented by default"
2350
+ )
2339
2351
);
2340
2352
2341
2353
}
@@ -2348,8 +2360,12 @@ public void testWildcardSystemIndexResolutionMultipleMatchesDeprecated() {
2348
2360
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2349
2361
assertThat (indexNames , containsInAnyOrder (".ml-meta" , ".ml-stuff" ));
2350
2362
assertWarnings (
2351
- "this request accesses system indices: [.ml-meta, .ml-stuff], but in a future major version, direct access "
2352
- + "to system indices will be prevented by default"
2363
+ true ,
2364
+ new DeprecationWarning (
2365
+ Level .WARN ,
2366
+ "this request accesses system indices: [.ml-meta, .ml-stuff], "
2367
+ + "but in a future major version, direct access to system indices will be prevented by default"
2368
+ )
2353
2369
);
2354
2370
2355
2371
}
@@ -2396,8 +2412,12 @@ public void testExternalSystemIndexAccess() {
2396
2412
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2397
2413
assertThat (indexNames , contains (".external-sys-idx" ));
2398
2414
assertWarnings (
2399
- "this request accesses system indices: [.external-sys-idx], but in a future major version, direct access "
2400
- + "to system indices will be prevented by default"
2415
+ true ,
2416
+ new DeprecationWarning (
2417
+ Level .WARN ,
2418
+ "this request accesses system indices: [.external-sys-idx], "
2419
+ + "but in a future major version, direct access to system indices will be prevented by default"
2420
+ )
2401
2421
);
2402
2422
}
2403
2423
}
@@ -2409,8 +2429,12 @@ public void testExternalSystemIndexAccess() {
2409
2429
List <String > indexNames = resolveConcreteIndexNameList (state , request );
2410
2430
assertThat (indexNames , contains (".external-sys-idx" ));
2411
2431
assertWarnings (
2412
- "this request accesses system indices: [.external-sys-idx], but in a future major version, direct access "
2413
- + "to system indices will be prevented by default"
2432
+ true ,
2433
+ new DeprecationWarning (
2434
+ Level .WARN ,
2435
+ "this request accesses system indices: [.external-sys-idx], "
2436
+ + "but in a future major version, direct access to system indices will be prevented by default"
2437
+ )
2414
2438
);
2415
2439
}
2416
2440
}
0 commit comments