Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <zaniu@amazon.com>
  • Loading branch information
zane-neo committed Sep 29, 2024
1 parent b84fd5d commit 62c17d5
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

package org.opensearch.action.support.nodes;

import org.mockito.ArgumentCaptor;
import org.opensearch.Version;
import org.opensearch.action.FailedNodeException;
import org.opensearch.action.support.ActionFilters;
Expand Down Expand Up @@ -78,10 +77,12 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;

import static org.mockito.Mockito.verify;
import org.mockito.ArgumentCaptor;

import static org.opensearch.test.ClusterServiceUtils.createClusterService;
import static org.opensearch.test.ClusterServiceUtils.setState;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class TransportNodesActionTests extends OpenSearchTestCase {

Expand Down Expand Up @@ -205,14 +206,20 @@ public void testTransportNodesActionWithDiscoveryNodesReset() {

public void testCreateTransportNodesActionWithListenableHandler() {
TransportNodesAction action = getListenableHandlerTestTransportNodesAction();
assertTrue(transport.getRequestHandlers().getHandler(action.actionName + "[n]").getHandler() instanceof TransportNodesAction.ListenableNodeTransportHandler);
assertTrue(
transport.getRequestHandlers()
.getHandler(action.actionName + "[n]")
.getHandler() instanceof TransportNodesAction.ListenableNodeTransportHandler
);
}

public void testMessageReceivedInListenableNodeTransportHandler() throws Exception {
TransportNodesAction action = getListenableHandlerTestTransportNodesAction();
TransportChannel transportChannel = mock(TransportChannel.class);
transport.getRequestHandlers().getHandler(action.actionName + "[n]").getHandler().messageReceived(new TestNodeRequest(), transportChannel, mock(
Task.class));
transport.getRequestHandlers()
.getHandler(action.actionName + "[n]")
.getHandler()
.messageReceived(new TestNodeRequest(), transportChannel, mock(Task.class));
ArgumentCaptor<TestNodeResponse> argCaptor = ArgumentCaptor.forClass(TestNodeResponse.class);
verify(transportChannel).sendResponse(argCaptor.capture());
TestNodeResponse response = argCaptor.getValue();
Expand Down

0 comments on commit 62c17d5

Please sign in to comment.