@Test(expected = NoSuchClientTypeException.class) public void shouldThrowNoSuchClientTypeException() throws NoSuchClientTypeException { String[] hostNames = { "127.0.0.1" }; factory.getClient("not_existing_client", hostNames, "test", null, null); }
public ElasticSearchClient getClient(String clientType, String[] hostNames, String clusterName, ElasticSearchEventSerializer serializer, ElasticSearchIndexRequestBuilderFactory indexBuilder) throws NoSuchClientTypeException { if (clientType.equalsIgnoreCase(TransportClient) && serializer != null) { return new ElasticSearchTransportClient(hostNames, clusterName, serializer); } else if (clientType.equalsIgnoreCase(TransportClient) && indexBuilder != null) { return new ElasticSearchTransportClient(hostNames, clusterName, indexBuilder); } else if (clientType.equalsIgnoreCase(RestClient) && serializer != null) { return new ElasticSearchRestClient(hostNames, serializer); } throw new NoSuchClientTypeException(); }
ElasticSearchClientFactory { public ElasticSearchClient getClient(String clientType, String[] hostNames, String clusterName, ElasticSearchEventSerializer serializer, ElasticSearchIndexRequestBuilderFactory indexBuilder) throws NoSuchClientTypeException { if (clientType.equalsIgnoreCase(TransportClient) && serializer != null) { return new ElasticSearchTransportClient(hostNames, clusterName, serializer); } else if (clientType.equalsIgnoreCase(TransportClient) && indexBuilder != null) { return new ElasticSearchTransportClient(hostNames, clusterName, indexBuilder); } else if (clientType.equalsIgnoreCase(RestClient) && serializer != null) { return new ElasticSearchRestClient(hostNames, serializer); } throw new NoSuchClientTypeException(); } }
ElasticSearchClientFactory { public ElasticSearchClient getClient(String clientType, String[] hostNames, String clusterName, ElasticSearchEventSerializer serializer, ElasticSearchIndexRequestBuilderFactory indexBuilder) throws NoSuchClientTypeException { if (clientType.equalsIgnoreCase(TransportClient) && serializer != null) { return new ElasticSearchTransportClient(hostNames, clusterName, serializer); } else if (clientType.equalsIgnoreCase(TransportClient) && indexBuilder != null) { return new ElasticSearchTransportClient(hostNames, clusterName, indexBuilder); } else if (clientType.equalsIgnoreCase(RestClient) && serializer != null) { return new ElasticSearchRestClient(hostNames, serializer); } throw new NoSuchClientTypeException(); }  }
ElasticSearchClientFactory { public ElasticSearchClient getClient(String clientType, String[] hostNames, String clusterName, ElasticSearchEventSerializer serializer, ElasticSearchIndexRequestBuilderFactory indexBuilder) throws NoSuchClientTypeException { if (clientType.equalsIgnoreCase(TransportClient) && serializer != null) { return new ElasticSearchTransportClient(hostNames, clusterName, serializer); } else if (clientType.equalsIgnoreCase(TransportClient) && indexBuilder != null) { return new ElasticSearchTransportClient(hostNames, clusterName, indexBuilder); } else if (clientType.equalsIgnoreCase(RestClient) && serializer != null) { return new ElasticSearchRestClient(hostNames, serializer); } throw new NoSuchClientTypeException(); }  ElasticSearchClient getClient(String clientType, String[] hostNames,
      String clusterName, ElasticSearchEventSerializer serializer,
      ElasticSearchIndexRequestBuilderFactory indexBuilder); ElasticSearchClient getLocalClient(String clientType,
                                            ElasticSearchEventSerializer serializer,
                                            ElasticSearchIndexRequestBuilderFactory indexBuilder); }
ElasticSearchClientFactory { public ElasticSearchClient getClient(String clientType, String[] hostNames, String clusterName, ElasticSearchEventSerializer serializer, ElasticSearchIndexRequestBuilderFactory indexBuilder) throws NoSuchClientTypeException { if (clientType.equalsIgnoreCase(TransportClient) && serializer != null) { return new ElasticSearchTransportClient(hostNames, clusterName, serializer); } else if (clientType.equalsIgnoreCase(TransportClient) && indexBuilder != null) { return new ElasticSearchTransportClient(hostNames, clusterName, indexBuilder); } else if (clientType.equalsIgnoreCase(RestClient) && serializer != null) { return new ElasticSearchRestClient(hostNames, serializer); } throw new NoSuchClientTypeException(); }  ElasticSearchClient getClient(String clientType, String[] hostNames,
      String clusterName, ElasticSearchEventSerializer serializer,
      ElasticSearchIndexRequestBuilderFactory indexBuilder); ElasticSearchClient getLocalClient(String clientType,
                                            ElasticSearchEventSerializer serializer,
                                            ElasticSearchIndexRequestBuilderFactory indexBuilder); static final String TransportClient; static final String RestClient; }