Skip to content

Commit

Permalink
spotless - test framework
Browse files Browse the repository at this point in the history
Signed-off-by: Pranshu Shukla <[email protected]>
  • Loading branch information
Pranshu-S committed Dec 3, 2024
1 parent b884cfc commit 6ea3fd6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,6 @@ public List<String> startNodes(int numOfNodes, Settings settings) {
return startNodes(Collections.nCopies(numOfNodes, settings).toArray(new Settings[0]));
}


/**
* Starts multiple nodes with the given settings and returns their names
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import reactor.util.annotation.NonNull;

import java.io.IOException;
import java.lang.Runtime.Version;
Expand Down Expand Up @@ -215,6 +214,8 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import reactor.util.annotation.NonNull;

import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_REPLICAS;
import static org.opensearch.cluster.metadata.IndexMetadata.SETTING_NUMBER_OF_SHARDS;
import static org.opensearch.common.unit.TimeValue.timeValueMillis;
Expand Down Expand Up @@ -2919,7 +2920,7 @@ protected static Settings buildRemoteStoreNodeAttributes(
protected Settings buildRemotePublicationNodeAttributes(
@NonNull String remoteStateRepoName,
@NonNull String remoteStateRepoType,
@NonNull String routingTableRepoName,
@NonNull String routingTableRepoName,
@NonNull String routingTableRepoType
) {
String remoteStateRepositoryTypeAttributeKey = String.format(
Expand Down Expand Up @@ -2948,8 +2949,8 @@ protected Settings buildRemotePublicationNodeAttributes(
.put("node.attr." + REMOTE_STORE_ROUTING_TABLE_REPOSITORY_NAME_ATTRIBUTE_KEY, routingTableRepoName)
.put(remoteStateRepositoryTypeAttributeKey, remoteStateRepoType)
.put(routingTableRepositoryTypeAttributeKey, routingTableRepoType)
.put(remoteStateRepositorySettingsAttributeKeyPrefix+"location", randomRepoPath().toAbsolutePath())
.put(routingTableRepositorySettingsAttributeKeyPrefix+"location", randomRepoPath().toAbsolutePath())
.put(remoteStateRepositorySettingsAttributeKeyPrefix + "location", randomRepoPath().toAbsolutePath())
.put(routingTableRepositorySettingsAttributeKeyPrefix + "location", randomRepoPath().toAbsolutePath())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,22 @@ public void addFailToSendNoConnectRule(TransportAddress transportAddress, final
/**
* Adds a rule that will cause matching operations to throw provided OpenSearch Exceptions
*/
public void addOpenSearchFailureException(TransportService transportService, final OpenSearchException exception, final String... blockedActions) {
public void addOpenSearchFailureException(
TransportService transportService,
final OpenSearchException exception,
final String... blockedActions
) {
addOpenSearchFailureException(transportService, exception, new HashSet<>(Arrays.asList(blockedActions)));
}

/**
* Adds a rule that will cause matching operations to throw provided OpenSearch Exceptions
*/
public void addOpenSearchFailureException(TransportService transportService, OpenSearchException exception, final Set<String> blockedActions) {
public void addOpenSearchFailureException(
TransportService transportService,
OpenSearchException exception,
final Set<String> blockedActions
) {
for (TransportAddress transportAddress : extractTransportAddresses(transportService)) {
addOpenSearchFailureException(transportAddress, exception, blockedActions);
}
Expand All @@ -396,7 +404,11 @@ public void addOpenSearchFailureException(TransportService transportService, Ope
/**
* Adds a rule that will cause matching operations to throw provided OpenSearch Exceptions
*/
public void addOpenSearchFailureException(TransportAddress transportAddress, OpenSearchException exception, final Set<String> blockedActions) {
public void addOpenSearchFailureException(
TransportAddress transportAddress,
OpenSearchException exception,
final Set<String> blockedActions
) {
transport().addSendBehavior(transportAddress, (connection, requestId, action, request, options) -> {
if (blockedActions.contains(action)) {
logger.info("--> preventing {} request", action);
Expand Down

0 comments on commit 6ea3fd6

Please sign in to comment.