Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
henningandersen committed Jan 20, 2025
1 parent 58737e4 commit cbe5483
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

package org.elasticsearch.upgrades;

import com.carrotsearch.randomizedtesting.annotations.Name;

import io.netty.handler.codec.http.HttpMethod;

import com.carrotsearch.randomizedtesting.annotations.Name;

import org.elasticsearch.TransportVersions;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.ResponseException;
Expand All @@ -22,7 +22,6 @@
import java.io.IOException;
import java.util.Map;


public class AddIndexBlockRollingUpgradeIT extends AbstractRollingUpgradeTestCase {

private static final String INDEX_NAME = "test_add_block";
Expand Down Expand Up @@ -52,16 +51,20 @@ public void testAddBlock() throws Exception {
private static void blockWrites() throws IOException {
client().performRequest(new Request(HttpMethod.PUT.name(), "/" + INDEX_NAME + "/_block/write"));

expectThrows(ResponseException.class, () -> client().performRequest(newXContentRequest(HttpMethod.PUT, "/" + INDEX_NAME + "/_doc/test",
(builder, params) -> builder.field("test", "test"))));
expectThrows(
ResponseException.class,
() -> client().performRequest(
newXContentRequest(HttpMethod.PUT, "/" + INDEX_NAME + "/_doc/test", (builder, params) -> builder.field("test", "test"))
)
);
}

@SuppressWarnings("unchecked")
private static String verifiedSettingValue() throws IOException {
final var settingsRequest = new Request(HttpMethod.GET.name(), "/" + INDEX_NAME + "/_settings?flat_settings");
final Map<String, Object> settingsResponse = entityAsMap(client().performRequest(settingsRequest));
// System.err.println(settingsResponse);
// throw new RuntimeException(settingsResponse.toString());
return (String) ((Map<String, Object>) ((Map<String, Object>) settingsResponse.get(INDEX_NAME)).get("settings")).get(MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey());
return (String) ((Map<String, Object>) ((Map<String, Object>) settingsResponse.get(INDEX_NAME)).get("settings")).get(
MetadataIndexStateService.VERIFIED_READ_ONLY_SETTING.getKey()
);
}
}

0 comments on commit cbe5483

Please sign in to comment.