@Test public void buildReturnsIndexOnlyConnector_forElasticsearch7() throws Exception { mockServerClient.when(HttpRequest.request().withPath("/")) .respond(HttpResponse.response().withBody("{" + " \"name\" : \"marla\"," + " \"cluster_name\" : \"elasticsearch\"," + " \"cluster_uuid\" : \"nWtbevzBTjOOHnbCmeTSjw\"," + " \"version\" : {" + " \"number\" : \"7.2.0\"," + " \"build_flavor\" : \"default\"," + " \"build_type\" : \"tar\"," + " \"build_hash\" : \"508c38a\"," + " \"build_date\" : \"2019-06-20T15:54:18.811730Z\"," + " \"build_snapshot\" : false," + " \"lucene_version\" : \"8.0.0\"," + " \"minimum_wire_compatibility_version\" : \"6.8.0\"," + " \"minimum_index_compatibility_version\" : \"6.0.0-beta1\"" + " }," + " \"tagline\" : \"You Know, for Search\"" + "}", MediaType.JSON_UTF_8)); ElasticsearchConnector connector = factory.buildConnector(); assertThat(connector).isInstanceOf(IndexOnlyElasticsearchConnector.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();  }