[TEST] Remove unnecessary usages of ListenableActionFuture
This commit is contained in:
parent
92bfd16c58
commit
194742b3f4
|
@ -31,7 +31,6 @@ import org.elasticsearch.test.ESTestCase;
|
|||
import org.junit.Before;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -77,12 +76,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
};
|
||||
|
||||
ArrayList<ActionFilter> actionFiltersByOrder = new ArrayList<>(filters);
|
||||
Collections.sort(actionFiltersByOrder, new Comparator<ActionFilter>() {
|
||||
@Override
|
||||
public int compare(ActionFilter o1, ActionFilter o2) {
|
||||
return Integer.compare(o1.order(), o2.order());
|
||||
}
|
||||
});
|
||||
actionFiltersByOrder.sort(Comparator.comparingInt(ActionFilter::order));
|
||||
|
||||
List<ActionFilter> expectedActionFilters = new ArrayList<>();
|
||||
boolean errorExpected = false;
|
||||
|
@ -97,7 +91,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
PlainListenableActionFuture<TestResponse> future = new PlainListenableActionFuture<>(null);
|
||||
PlainActionFuture<TestResponse> future = new PlainActionFuture<>();
|
||||
transportAction.execute(new TestRequest(), future);
|
||||
try {
|
||||
assertThat(future.get(), notNullValue());
|
||||
|
@ -110,12 +104,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
for (ActionFilter actionFilter : actionFilters.filters()) {
|
||||
testFiltersByLastExecution.add((RequestTestFilter) actionFilter);
|
||||
}
|
||||
Collections.sort(testFiltersByLastExecution, new Comparator<RequestTestFilter>() {
|
||||
@Override
|
||||
public int compare(RequestTestFilter o1, RequestTestFilter o2) {
|
||||
return Integer.compare(o1.executionToken, o2.executionToken);
|
||||
}
|
||||
});
|
||||
testFiltersByLastExecution.sort(Comparator.comparingInt(o -> o.executionToken));
|
||||
|
||||
ArrayList<RequestTestFilter> finalTestFilters = new ArrayList<>();
|
||||
for (ActionFilter filter : testFiltersByLastExecution) {
|
||||
|
|
|
@ -21,7 +21,7 @@ package org.elasticsearch.client.transport;
|
|||
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
|
||||
import org.elasticsearch.action.support.PlainListenableActionFuture;
|
||||
import org.elasticsearch.action.support.PlainActionFuture;
|
||||
import org.elasticsearch.client.Requests;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
|
@ -69,7 +69,7 @@ public class TransportClientRetryIT extends ESIntegTestCase {
|
|||
if (randomBoolean()) {
|
||||
clusterState = client.admin().cluster().state(clusterStateRequest).get().getState();
|
||||
} else {
|
||||
PlainListenableActionFuture<ClusterStateResponse> future = new PlainListenableActionFuture<>(client.threadPool());
|
||||
PlainActionFuture<ClusterStateResponse> future = new PlainActionFuture<>();
|
||||
client.admin().cluster().state(clusterStateRequest, future);
|
||||
clusterState = future.get().getState();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue