diff --git a/server/src/test/java/org/opensearch/gateway/PrimaryShardBatchAllocatorTests.java b/server/src/test/java/org/opensearch/gateway/PrimaryShardBatchAllocatorTests.java index fc56f976b6cdc..7e88fcbb76a7f 100644 --- a/server/src/test/java/org/opensearch/gateway/PrimaryShardBatchAllocatorTests.java +++ b/server/src/test/java/org/opensearch/gateway/PrimaryShardBatchAllocatorTests.java @@ -137,16 +137,35 @@ public void testDecisionTakenForNewIndexShards() { .routingTable(routingTableBuilder.build()) .nodes(DiscoveryNodes.builder().add(node1).add(node2).add(node3)) .build(); - RoutingAllocation newIndexRoutingAllocation = new RoutingAllocation(noAllocationDeciders(), new RoutingNodes(state, false), state, null, null, System.nanoTime()); + RoutingAllocation newIndexRoutingAllocation = new RoutingAllocation( + noAllocationDeciders(), + new RoutingNodes(state, false), + state, + null, + null, + System.nanoTime() + ); - ShardRouting primaryShard1 = newIndexRoutingAllocation.routingTable().getIndicesRouting().get("test").shard(shard1.id()).primaryShard(); - ShardRouting primaryShard2 = newIndexRoutingAllocation.routingTable().getIndicesRouting().get("test").shard(shard2.id()).primaryShard(); + ShardRouting primaryShard1 = newIndexRoutingAllocation.routingTable() + .getIndicesRouting() + .get("test") + .shard(shard1.id()) + .primaryShard(); + ShardRouting primaryShard2 = newIndexRoutingAllocation.routingTable() + .getIndicesRouting() + .get("test") + .shard(shard2.id()) + .primaryShard(); List shards = new ArrayList<>(); shards.add(primaryShard1); shards.add(primaryShard2); - HashMap allDecisions = batchAllocator.makeAllocationDecision(shards, newIndexRoutingAllocation, logger); + HashMap allDecisions = batchAllocator.makeAllocationDecision( + shards, + newIndexRoutingAllocation, + logger + ); // verify we get decisions for all the shards assertEquals(shards.size(), allDecisions.size()); assertEquals(shards, new ArrayList<>(allDecisions.keySet()));