ElasticsearchIndexInformation implements IndexInformation { @Override public String getFieldMappings(String indexName) { GetMappingsRequest getMappingsRequest = new GetMappingsRequest(); getMappingsRequest.indices(indexName); GetMappingsResponse getMappingsResponse = getMappingsResponse( getMappingsRequest); return Strings.toString(getMappingsResponse, true, true); }  @Override String getCompanyIndexName(long companyId); @Override String getFieldMappings(String indexName); @Override String[] getIndexNames();  }
@Test public void testGetFieldMappings() throws Exception { _companyIndexFactoryFixture.createIndices(); String fieldMappings = _elasticsearchIndexInformation.getFieldMappings( _companyIndexFactoryFixture.getIndexName()); AssertUtils.assertEquals( "", loadJSONObject(testName.getMethodName()), _jsonFactory.createJSONObject(fieldMappings)); }