Search in sources :

Example 1 with JobResponse

use of io.crate.action.job.JobResponse in project crate by crate.

the class RemoteCollectorTest method testKillRequestsAreMadeIfCollectorIsKilledAfterRemoteContextCreation.

@Test
public void testKillRequestsAreMadeIfCollectorIsKilledAfterRemoteContextCreation() throws Exception {
    remoteCollector.doCollect();
    verify(transportJobAction, times(1)).execute(eq("remoteNode"), any(JobRequest.class), listenerCaptor.capture());
    remoteCollector.kill(new InterruptedException());
    ActionListener<JobResponse> listener = listenerCaptor.getValue();
    listener.onResponse(new JobResponse());
    verify(transportKillJobsNodeAction, times(1)).broadcast(any(KillJobsRequest.class), any(ActionListener.class));
}
Also used : JobRequest(io.crate.action.job.JobRequest) ActionListener(org.elasticsearch.action.ActionListener) KillJobsRequest(io.crate.executor.transport.kill.KillJobsRequest) JobResponse(io.crate.action.job.JobResponse) Test(org.junit.Test)

Aggregations

JobRequest (io.crate.action.job.JobRequest)1 JobResponse (io.crate.action.job.JobResponse)1 KillJobsRequest (io.crate.executor.transport.kill.KillJobsRequest)1 ActionListener (org.elasticsearch.action.ActionListener)1 Test (org.junit.Test)1