Skip to content

Commit fae7738

Browse files
elasticsearchmachinedimitris-athanasiou
authored andcommitted
[CI] Auto commit changes from spotless
1 parent 6ab512d commit fae7738

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/CCSFieldCapabilitiesIT.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ public void testFailuresFromRemote() throws IOException {
6464
// Closed shards will result to index error because shards must be in readable state
6565
FieldCapabilitiesIT.closeShards(cluster("remote_cluster"), remoteErrorIndex);
6666

67-
response = client().prepareFieldCaps("*", "remote_cluster:*")
68-
.setFields("*")
69-
.get();
67+
response = client().prepareFieldCaps("*", "remote_cluster:*").setFields("*").get();
7068
assertThat(response.getIndices()[0], equalTo(localIndex));
7169
assertThat(response.getFailedIndicesCount(), equalTo(1));
7270
FieldCapabilitiesFailure failure = response.getFailures()
@@ -78,23 +76,21 @@ public void testFailuresFromRemote() throws IOException {
7876
assertEquals(RemoteTransportException.class, ex.getClass());
7977
Throwable cause = ExceptionsHelper.unwrapCause(ex);
8078
assertEquals(IllegalIndexShardStateException.class, cause.getClass());
81-
assertEquals("CurrentState[CLOSED] operations only allowed when shard state is one of [POST_RECOVERY, STARTED]", cause.getMessage());
79+
assertEquals(
80+
"CurrentState[CLOSED] operations only allowed when shard state is one of [POST_RECOVERY, STARTED]",
81+
cause.getMessage()
82+
);
8283

8384
// if we only query the remote we should get back an exception only
84-
ex = expectThrows(
85-
IllegalIndexShardStateException.class,
86-
client().prepareFieldCaps("remote_cluster:*").setFields("*")
87-
);
85+
ex = expectThrows(IllegalIndexShardStateException.class, client().prepareFieldCaps("remote_cluster:*").setFields("*"));
8886
assertEquals("CurrentState[CLOSED] operations only allowed when shard state is one of [POST_RECOVERY, STARTED]", ex.getMessage());
8987

9088
// add an index that doesn't fail to the remote
9189
assertAcked(remoteClient.admin().indices().prepareCreate("okay_remote_index"));
9290
remoteClient.prepareIndex("okay_remote_index").setId("2").setSource("foo", "bar").get();
9391
remoteClient.admin().indices().prepareRefresh("okay_remote_index").get();
9492

95-
response = client().prepareFieldCaps("*", "remote_cluster:*")
96-
.setFields("*")
97-
.get();
93+
response = client().prepareFieldCaps("*", "remote_cluster:*").setFields("*").get();
9894
assertThat(Arrays.asList(response.getIndices()), containsInAnyOrder(localIndex, "remote_cluster:okay_remote_index"));
9995
assertThat(response.getFailedIndicesCount(), equalTo(1));
10096
failure = response.getFailures()

server/src/internalClusterTest/java/org/elasticsearch/search/fieldcaps/FieldCapabilitiesIT.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,10 @@ public void testFailures() throws IOException {
462462
assertThat(response.getFailures().get(0).getIndices(), arrayContainingInAnyOrder("index1-error", "index2-error"));
463463
Exception failure = response.getFailures().get(0).getException();
464464
assertEquals(IllegalIndexShardStateException.class, failure.getClass());
465-
assertEquals("CurrentState[CLOSED] operations only allowed when shard state is one of [POST_RECOVERY, STARTED]", failure.getMessage());
465+
assertEquals(
466+
"CurrentState[CLOSED] operations only allowed when shard state is one of [POST_RECOVERY, STARTED]",
467+
failure.getMessage()
468+
);
466469

467470
// the "indices" section should not include failed ones
468471
assertThat(Arrays.asList(response.getIndices()), containsInAnyOrder("old_index", "new_index"));
@@ -919,7 +922,7 @@ private void assertIndices(FieldCapabilitiesResponse response, String... indices
919922

920923
static void closeShards(InternalTestCluster cluster, String... indices) throws IOException {
921924
final Set<String> indicesToClose = Set.of(indices);
922-
for (String node :cluster.getNodeNames()) {
925+
for (String node : cluster.getNodeNames()) {
923926
final IndicesService indicesService = cluster.getInstance(IndicesService.class, node);
924927
for (IndexService indexService : indicesService) {
925928
if (indicesToClose.contains(indexService.getMetadata().getIndex().getName())) {

0 commit comments

Comments
 (0)