@Test public void buildReturnsMappingsConnector_forElasticsearch6() throws Exception { mockServerClient.when(HttpRequest.request().withPath("/")) .respond(HttpResponse.response().withBody("{" + " \"name\" : \"jV1j7Sd\"," + " \"cluster_name\" : \"elasticsearch\"," + " \"cluster_uuid\" : \"fKmeADu0Rh2I8DVeaCnAVQ\"," + " \"version\" : {" + " \"number\" : \"6.2.3\"," + " \"build_hash\" : \"c59ff00\"," + " \"build_date\" : \"2018-03-13T10:06:29.741383Z\"," + " \"build_snapshot\" : false," + " \"lucene_version\" : \"7.2.1\"," + " \"minimum_wire_compatibility_version\" : \"5.6.0\"," + " \"minimum_index_compatibility_version\" : \"5.0.0\"" + " }," + " \"tagline\" : \"You Know, for Search\"" + "}", MediaType.JSON_UTF_8)); ElasticsearchConnector connector = factory.buildConnector(); assertThat(connector).isInstanceOf(MappingTypeElasticsearchConnector.class); }
public ElasticsearchConnector buildConnector() throws IOException { final ElasticsearchConnector connector; if (versionAllowsTypes(getVersionDetails())) { connector = new MappingTypeElasticsearchConnector(client); } else { connector = new IndexOnlyElasticsearchConnector(client); } return connector; }
ElasticsearchConnectorFactory { public ElasticsearchConnector buildConnector() throws IOException { final ElasticsearchConnector connector; if (versionAllowsTypes(getVersionDetails())) { connector = new MappingTypeElasticsearchConnector(client); } else { connector = new IndexOnlyElasticsearchConnector(client); } return connector; } }
ElasticsearchConnectorFactory { public ElasticsearchConnector buildConnector() throws IOException { final ElasticsearchConnector connector; if (versionAllowsTypes(getVersionDetails())) { connector = new MappingTypeElasticsearchConnector(client); } else { connector = new IndexOnlyElasticsearchConnector(client); } return connector; } ElasticsearchConnectorFactory(RestHighLevelClient client); }
ElasticsearchConnectorFactory { public ElasticsearchConnector buildConnector() throws IOException { final ElasticsearchConnector connector; if (versionAllowsTypes(getVersionDetails())) { connector = new MappingTypeElasticsearchConnector(client); } else { connector = new IndexOnlyElasticsearchConnector(client); } return connector; } ElasticsearchConnectorFactory(RestHighLevelClient client); ElasticsearchConnector buildConnector(); }
ElasticsearchConnectorFactory { public ElasticsearchConnector buildConnector() throws IOException { final ElasticsearchConnector connector; if (versionAllowsTypes(getVersionDetails())) { connector = new MappingTypeElasticsearchConnector(client); } else { connector = new IndexOnlyElasticsearchConnector(client); } return connector; } ElasticsearchConnectorFactory(RestHighLevelClient client); ElasticsearchConnector buildConnector();  }