RestElasticClient implements ElasticClient { @Override public List<String> getTypes(String indexName) throws IOException { return new ArrayList<>(getMappings(indexName, null).keySet()); } RestElasticClient(RestClient client);  RestElasticClient(RestClient client, RestClient proxyClient, boolean enableRunAs); @Override double getVersion(); @Override List<String> getTypes(String indexName); @Override Map<String, Object> getMapping(String indexName, String type); @Override ElasticResponse search(String searchIndices, String type, ElasticRequest request); @Override ElasticResponse scroll(String scrollId, Integer scrollTime); @Override void clearScroll(Set<String> scrollIds); @Override void close(); @SuppressWarnings("unchecked") static void removeMapping(String parent, String key, Map<String,Object> data, String currentParent);  }
@Test public void testGetTypes() throws IOException { String content = "{\"status_s\": {\"mappings\": " + "{\"properties\": {\"status_s\": {\"type\": \"keyword\"}}}}}"; InputStream inputStream = new ByteArrayInputStream(content.getBytes()); when(mockEntity.getContent()).thenReturn(inputStream); when(mockRestClient.performRequest(new Request("GET", "/status_s/_mapping"))).thenReturn(mockResponse); List<String> names = client.getTypes("status_s"); assertEquals(1, names.size()); }