Skip to content

Commit f25ea2b

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 8f42295 commit f25ea2b

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/CcrLicenseCheckerTests.java

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@
4444
import static org.hamcrest.Matchers.equalTo;
4545
import static org.hamcrest.Matchers.hasToString;
4646
import static org.hamcrest.Matchers.instanceOf;
47-
import static org.hamcrest.Matchers.matchesPattern;
4847
import static org.mockito.ArgumentMatchers.any;
4948
import static org.mockito.ArgumentMatchers.eq;
50-
import static org.mockito.ArgumentMatchers.matches;
5149
import static org.mockito.Mockito.mock;
5250
import static org.mockito.Mockito.times;
5351
import static org.mockito.Mockito.verify;
@@ -107,24 +105,25 @@ public void testRemoteIndexValidation() {
107105
.numberOfReplicas(1)
108106
.state(IndexMetadata.State.CLOSE)
109107
.build();
110-
IndexMetadata firstBackingIndex = DataStreamTestHelper.createFirstBackingIndex(dataStreamName)
111-
.build();
108+
IndexMetadata firstBackingIndex = DataStreamTestHelper.createFirstBackingIndex(dataStreamName).build();
112109
IndexMetadata firstFailureStore = DataStreamTestHelper.createFirstFailureStore(dataStreamName).build();
113110
DataStream dataStream = DataStreamTestHelper.newInstance(
114111
dataStreamName,
115112
List.of(firstBackingIndex.getIndex()),
116113
List.of(firstFailureStore.getIndex())
117114
);
118115
ClusterState remoteClusterState = ClusterState.builder(new ClusterName(randomIdentifier()))
119-
.metadata(Metadata.builder()
120-
.put(indexMetadata, false)
121-
.put(closedIndexMetadata, false)
122-
.put(firstBackingIndex, false)
123-
.put(firstFailureStore, false)
124-
.dataStreams(
125-
Map.of(dataStreamName, dataStream),
126-
Map.of(dsAliasName, new DataStreamAlias(dsAliasName, List.of(dataStreamName), dataStreamName, Map.of()))
127-
))
116+
.metadata(
117+
Metadata.builder()
118+
.put(indexMetadata, false)
119+
.put(closedIndexMetadata, false)
120+
.put(firstBackingIndex, false)
121+
.put(firstFailureStore, false)
122+
.dataStreams(
123+
Map.of(dataStreamName, dataStream),
124+
Map.of(dsAliasName, new DataStreamAlias(dsAliasName, List.of(dataStreamName), dataStreamName, Map.of()))
125+
)
126+
)
128127
.build();
129128

130129
final boolean isCcrAllowed = randomBoolean();
@@ -149,7 +148,12 @@ protected void doCheckRemoteClusterLicenseAndFetchClusterState(
149148
}
150149

151150
@Override
152-
public void hasPrivilegesToFollowIndices(ThreadContext threadContext, RemoteClusterClient remoteClient, String[] indices, Consumer<Exception> handler) {
151+
public void hasPrivilegesToFollowIndices(
152+
ThreadContext threadContext,
153+
RemoteClusterClient remoteClient,
154+
String[] indices,
155+
Consumer<Exception> handler
156+
) {
153157
fail("Test case should fail before this code is called");
154158
}
155159
};
@@ -176,21 +180,21 @@ public void hasPrivilegesToFollowIndices(ThreadContext threadContext, RemoteClus
176180
{
177181
Exception exception = executeExpectingException(checker, mockClient, clusterAlias, aliasName);
178182
assertThat(exception, instanceOf(IllegalArgumentException.class));
179-
assertThat(exception.getMessage(), equalTo("cannot follow ["+aliasName+"], because it is a ALIAS"));
183+
assertThat(exception.getMessage(), equalTo("cannot follow [" + aliasName + "], because it is a ALIAS"));
180184
}
181185

182186
// When following a data stream, throw IllegalArgumentException
183187
{
184188
Exception exception = executeExpectingException(checker, mockClient, clusterAlias, dataStreamName);
185189
assertThat(exception, instanceOf(IllegalArgumentException.class));
186-
assertThat(exception.getMessage(), equalTo("cannot follow ["+dataStreamName+"], because it is a DATA_STREAM"));
190+
assertThat(exception.getMessage(), equalTo("cannot follow [" + dataStreamName + "], because it is a DATA_STREAM"));
187191
}
188192

189193
// When following a data stream alias, throw IllegalArgumentException
190194
{
191195
Exception exception = executeExpectingException(checker, mockClient, clusterAlias, dsAliasName);
192196
assertThat(exception, instanceOf(IllegalArgumentException.class));
193-
assertThat(exception.getMessage(), equalTo("cannot follow ["+dsAliasName+"], because it is a ALIAS"));
197+
assertThat(exception.getMessage(), equalTo("cannot follow [" + dsAliasName + "], because it is a ALIAS"));
194198
}
195199

196200
// When following a closed index, throw IndexClosedException

0 commit comments

Comments
 (0)