Merge branch '1.4.x' into 1.5.x

pull/7075/head
Stephane Nicoll 8 years ago
commit 7ffa499949

@ -56,7 +56,7 @@ public class JestAutoConfiguration {
this.gsonProvider = gsonProvider; this.gsonProvider = gsonProvider;
} }
@Bean @Bean(destroyMethod = "shutdownClient")
@ConditionalOnMissingBean @ConditionalOnMissingBean
public JestClient jestClient() { public JestClient jestClient() {
JestClientFactory factory = new JestClientFactory(); JestClientFactory factory = new JestClientFactory();

@ -16,6 +16,7 @@
package org.springframework.boot.autoconfigure.elasticsearch.jest; package org.springframework.boot.autoconfigure.elasticsearch.jest;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -33,7 +34,8 @@ public class JestProperties {
/** /**
* Comma-separated list of the Elasticsearch instances to use. * Comma-separated list of the Elasticsearch instances to use.
*/ */
private List<String> uris = Collections.singletonList("http://localhost:9200"); private List<String> uris = new ArrayList<String>(Collections.singletonList(
"http://localhost:9200"));
/** /**
* Login user. * Login user.

@ -108,6 +108,10 @@
"description": "Enable Solr repositories.", "description": "Enable Solr repositories.",
"defaultValue": true "defaultValue": true
}, },
{
"name": "spring.elasticsearch.jest.uris",
"defaultValue": ["http://localhost:9200"]
},
{ {
"name": "spring.http.encoding.enabled", "name": "spring.http.encoding.enabled",
"type": "java.lang.Boolean", "type": "java.lang.Boolean",

@ -73,7 +73,7 @@ public class JestAutoConfigurationTests {
@Test @Test
public void customJestClient() { public void customJestClient() {
load(CustomJestClient.class, load(CustomJestClient.class,
"spring.elasticsearch.jest.uris=http://localhost:9200"); "spring.elasticsearch.jest.uris[0]=http://localhost:9200");
assertThat(this.context.getBeansOfType(JestClient.class)).hasSize(1); assertThat(this.context.getBeansOfType(JestClient.class)).hasSize(1);
} }

Loading…
Cancel
Save