ElasticsearchClient { public String getHosts() { return hosts; } protected  ElasticsearchClient(); static synchronized ElasticsearchClient getSingleton(); String getHosts(); void setHosts(String hosts); @PostConstruct void init(); String getIndex(String tenantId); @SuppressWarnings("unchecked") void initTenant(String tenantId); Client getClient(); void clearTenant(String tenantId); @PreDestroy void close(); @Override String toString(); static final String SETTINGS; static final String MAPPINGS; static final String DEFAULT_SETTING; static final String ELASTICSEARCH_HOSTS; static final String ELASTICSEARCH_HOSTS_DEFAULT; static final String ELASTICSEARCH_CLUSTER; static final String ELASTICSEARCH_CLUSTER_DEFAULT; }
@Test public void testDefaultElasticsearchHostNull() { System.clearProperty(ElasticsearchClient.ELASTICSEARCH_HOSTS); ElasticsearchClient client = new ElasticsearchClient(); assertEquals(ElasticsearchClient.ELASTICSEARCH_HOSTS_DEFAULT, client.getHosts()); }
@Test public void testDefaultElasticsearchHostEmptyString() { System.setProperty(ElasticsearchClient.ELASTICSEARCH_HOSTS, ""); ElasticsearchClient client = new ElasticsearchClient(); assertEquals(ElasticsearchClient.ELASTICSEARCH_HOSTS_DEFAULT, client.getHosts()); }
@Test public void testDefaultElasticsearchHostValue() { System.setProperty(ElasticsearchClient.ELASTICSEARCH_HOSTS, TESTHOSTS); ElasticsearchClient client = new ElasticsearchClient(); assertEquals(TESTHOSTS, client.getHosts()); }