Search in sources :

Example 1 with TransportKillAllNodeAction

use of io.crate.executor.transport.kill.TransportKillAllNodeAction in project crate by crate.

the class KillTaskTest method testKillTaskCallsBroadcastOnTransportKillAllNodeAction.

@SuppressWarnings("unchecked")
@Test
public void testKillTaskCallsBroadcastOnTransportKillAllNodeAction() throws Exception {
    TransportKillAllNodeAction killAllNodeAction = mock(TransportKillAllNodeAction.class);
    KillTask task = new KillTask(killAllNodeAction, UUID.randomUUID());
    task.execute(new TestingBatchConsumer(), Row.EMPTY);
    verify(killAllNodeAction, times(1)).broadcast(any(KillAllRequest.class), any(ActionListener.class));
    verify(killAllNodeAction, times(0)).nodeOperation(any(KillAllRequest.class), any(ActionListener.class));
}
Also used : KillAllRequest(io.crate.executor.transport.kill.KillAllRequest) ActionListener(org.elasticsearch.action.ActionListener) TransportKillAllNodeAction(io.crate.executor.transport.kill.TransportKillAllNodeAction) TestingBatchConsumer(io.crate.testing.TestingBatchConsumer) Test(org.junit.Test) CrateUnitTest(io.crate.test.integration.CrateUnitTest)

Aggregations

KillAllRequest (io.crate.executor.transport.kill.KillAllRequest)1 TransportKillAllNodeAction (io.crate.executor.transport.kill.TransportKillAllNodeAction)1 CrateUnitTest (io.crate.test.integration.CrateUnitTest)1 TestingBatchConsumer (io.crate.testing.TestingBatchConsumer)1 ActionListener (org.elasticsearch.action.ActionListener)1 Test (org.junit.Test)1