Fix list property to be mutable

Closes gh-7045
This commit is contained in:
Stephane Nicoll 2016-09-30 10:34:25 +02:00
parent cf4142dbc0
commit 8ed20068ca
3 changed files with 8 additions and 2 deletions

View File

@ -16,6 +16,7 @@
package org.springframework.boot.autoconfigure.elasticsearch.jest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -33,7 +34,8 @@ public class JestProperties {
/**
* 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.

View File

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

View File

@ -73,7 +73,7 @@ public class JestAutoConfigurationTests {
@Test
public void customJestClient() {
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);
}