Fix compilation in TransportReplicationActionTests

This commit is contained in:
Yannick Welsch 2016-02-02 14:08:19 +01:00
parent 8cca0395ef
commit 13ad335416

View File

@ -221,7 +221,7 @@ public class TransportReplicationActionTests extends ESTestCase {
*/ */
public void testNoRerouteOnStaleClusterState() throws InterruptedException, ExecutionException { public void testNoRerouteOnStaleClusterState() throws InterruptedException, ExecutionException {
final String index = "test"; final String index = "test";
final ShardId shardId = new ShardId(index, 0); final ShardId shardId = new ShardId(index, "_na_", 0);
ClusterState state = state(index, true, ShardRoutingState.RELOCATING); ClusterState state = state(index, true, ShardRoutingState.RELOCATING);
String relocationTargetNode = state.getRoutingTable().shardRoutingTable(shardId).primaryShard().relocatingNodeId(); String relocationTargetNode = state.getRoutingTable().shardRoutingTable(shardId).primaryShard().relocatingNodeId();
state = ClusterState.builder(state).nodes(DiscoveryNodes.builder(state.nodes()).localNodeId(relocationTargetNode)).build(); state = ClusterState.builder(state).nodes(DiscoveryNodes.builder(state.nodes()).localNodeId(relocationTargetNode)).build();
@ -230,13 +230,13 @@ public class TransportReplicationActionTests extends ESTestCase {
Request request = new Request(shardId).timeout("1ms").routedBasedOnClusterVersion(clusterService.state().version() + 1); Request request = new Request(shardId).timeout("1ms").routedBasedOnClusterVersion(clusterService.state().version() + 1);
PlainActionFuture<Response> listener = new PlainActionFuture<>(); PlainActionFuture<Response> listener = new PlainActionFuture<>();
TransportReplicationAction.ReroutePhase reroutePhase = action.new ReroutePhase(request, listener); TransportReplicationAction.ReroutePhase reroutePhase = action.new ReroutePhase(null, request, listener);
reroutePhase.run(); reroutePhase.run();
assertListenerThrows("cluster state too old didn't cause a timeout", listener, UnavailableShardsException.class); assertListenerThrows("cluster state too old didn't cause a timeout", listener, UnavailableShardsException.class);
request = new Request(shardId).routedBasedOnClusterVersion(clusterService.state().version() + 1); request = new Request(shardId).routedBasedOnClusterVersion(clusterService.state().version() + 1);
listener = new PlainActionFuture<>(); listener = new PlainActionFuture<>();
reroutePhase = action.new ReroutePhase(request, listener); reroutePhase = action.new ReroutePhase(null, request, listener);
reroutePhase.run(); reroutePhase.run();
assertFalse("cluster state too old didn't cause a retry", listener.isDone()); assertFalse("cluster state too old didn't cause a retry", listener.isDone());