return indexName;
}
});
bind(ShardId.class).toInstance(shardId);
IndexShard indexShard = mock(IndexShard.class);
bind(IndexShard.class).toInstance(indexShard);
StoreStats storeStats = mock(StoreStats.class);
when(indexShard.storeStats()).thenReturn(storeStats);
when(storeStats.getSizeInBytes()).thenReturn(123456L);
DocsStats docsStats = mock(DocsStats.class);
when(indexShard.docStats()).thenReturn(docsStats).thenThrow(IllegalIndexShardStateException.class);
when(docsStats.getCount()).thenReturn(654321L);
ShardRouting shardRouting = mock(ShardRouting.class);
when(indexShard.routingEntry()).thenReturn(shardRouting);
when(shardRouting.primary()).thenReturn(true);
when(shardRouting.relocatingNodeId()).thenReturn("node_X");
TransportPutIndexTemplateAction transportPutIndexTemplateAction = mock(TransportPutIndexTemplateAction.class);
bind(TransportPutIndexTemplateAction.class).toInstance(transportPutIndexTemplateAction);
when(indexShard.state()).thenReturn(IndexShardState.STARTED);
MetaData metaData = mock(MetaData.class);
when(metaData.hasConcreteIndex(Constants.PARTITIONED_TABLE_PREFIX + ".wikipedia_de._1")).thenReturn(false);
ClusterState clusterState = mock(ClusterState.class);
when(clusterService.state()).thenReturn(clusterState);