MetaData.Builder metaDataBuilder = newMetaDataBuilder();
for (int i = 0; i < numberOfIndices; i++) {
metaDataBuilder.put(newIndexMetaDataBuilder("test" + i).numberOfShards(1).numberOfReplicas(0));
}
MetaData metaData = metaDataBuilder.build();
RoutingTable.Builder routingTableBuilder = routingTable();
for (int i = 0; i < numberOfIndices; i++) {
routingTableBuilder.add(indexRoutingTable("test" + i).initializeEmpty(metaData.index("test" + i)));
}
RoutingTable routingTable = routingTableBuilder.build();
ClusterState clusterState = newClusterStateBuilder().metaData(metaData).routingTable(routingTable).build();
assertThat(routingTable.indicesRouting().size(), equalTo(numberOfIndices));