@Test(expected = IOException.class) public void buildThrowsException_whenServerFails() throws Exception { mockServerClient.when(HttpRequest.request().withPath("/")) .error(HttpError.error().withDropConnection(true)); factory.buildConnector(); }
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();  }