ClusterStateRequest clusterStateRequest = Requests.clusterStateRequest().filteredIndices("users");
IndexMetaData metaData = esSetup.client().admin().cluster().state(clusterStateRequest).actionGet().getState().metaData().index("users");
assertEquals("{\"d\":{\"properties\":{\"name\":{\"type\":\"string\",\"index\":\"not_analyzed\",\"store\":true,\"omit_norms\":true,\"index_options\":\"docs\"}}}}",
metaData.mappings().get("d").source().toString());
assertEquals(2, metaData.numberOfShards());
assertEquals(0, metaData.numberOfReplicas());
}
private boolean existsWithField(String id, String field, String value, String index, String type) {