|
9 | 9 |
|
10 | 10 | package org.elasticsearch.test.rest; |
11 | 11 |
|
12 | | -import io.netty.handler.codec.http.HttpMethod; |
13 | | - |
14 | 12 | import org.apache.http.Header; |
15 | 13 | import org.apache.http.HttpEntity; |
16 | 14 | import org.apache.http.HttpHost; |
|
147 | 145 | import static org.hamcrest.Matchers.in; |
148 | 146 | import static org.hamcrest.Matchers.notNullValue; |
149 | 147 |
|
| 148 | +import io.netty.handler.codec.http.HttpMethod; |
| 149 | + |
150 | 150 | /** |
151 | 151 | * Superclass for tests that interact with an external test cluster using Elasticsearch's {@link RestClient}. |
152 | 152 | */ |
@@ -427,14 +427,12 @@ public void initClient() throws IOException { |
427 | 427 | assert semanticNodeVersions.isEmpty() == false || serverless; |
428 | 428 |
|
429 | 429 | if (multiProjectPluginVariant != null) { |
430 | | - final var response = entityAsMap( |
431 | | - adminClient.performRequest( |
432 | | - new Request( |
433 | | - "GET", |
434 | | - "/_cluster/settings?include_defaults&filter_path=*." + multiProjectPluginVariant + ".multi_project.enabled" |
435 | | - ) |
436 | | - ) |
| 430 | + final Request settingRequest = new Request( |
| 431 | + "GET", |
| 432 | + "/_cluster/settings?include_defaults&filter_path=*." + multiProjectPluginVariant + ".multi_project.enabled" |
437 | 433 | ); |
| 434 | + settingRequest.setOptions(RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE)); |
| 435 | + final var response = entityAsMap(adminClient.performRequest(settingRequest)); |
438 | 436 | multiProjectEnabled = Boolean.parseBoolean( |
439 | 437 | ObjectPath.evaluate(response, "defaults." + multiProjectPluginVariant + ".multi_project.enabled") |
440 | 438 | ); |
@@ -1291,9 +1289,6 @@ protected void wipeSearchableSnapshotsIndices() throws IOException { |
1291 | 1289 | // retrieves all indices with a type of store equals to "snapshot" |
1292 | 1290 | final Request request = new Request("GET", "_cluster/state/metadata"); |
1293 | 1291 | request.addParameter("filter_path", "metadata.indices.*.settings.index.store.snapshot"); |
1294 | | - if (multiProjectEnabled) { |
1295 | | - request.addParameter("multi_project", "true"); |
1296 | | - } |
1297 | 1292 |
|
1298 | 1293 | final Response response = cleanupClient().performRequest(request); |
1299 | 1294 | @SuppressWarnings("unchecked") |
|
0 commit comments