diff --git a/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java b/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java index 445dc359..9730085b 100644 --- a/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java +++ b/spring-cloud-consul-config/src/main/java/org/springframework/cloud/consul/config/ConsulPropertySource.java @@ -46,7 +46,7 @@ public class ConsulPropertySource extends EnumerablePropertySource private String context; private ConsulConfigProperties configProperties; - private final Map properties = new LinkedHashMap<>(); + private final Map properties = new LinkedHashMap<>(); public ConsulPropertySource(String context, ConsulClient source, ConsulConfigProperties configProperties) { @@ -123,7 +123,7 @@ public class ConsulPropertySource extends EnumerablePropertySource for (Map.Entry entry : props.entrySet()) { properties - .put(entry.getKey().toString(), entry.getValue().toString()); + .put(entry.getKey().toString(), entry.getValue()); } } @@ -164,7 +164,7 @@ public class ConsulPropertySource extends EnumerablePropertySource return new String(decodeFromString(value)); } - protected Map getProperties() { + protected Map getProperties() { return properties; } diff --git a/spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourceTests.java b/spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourceTests.java index 3db49d96..0f7a8f62 100644 --- a/spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourceTests.java +++ b/spring-cloud-consul-config/src/test/java/org/springframework/cloud/consul/config/ConsulPropertySourceTests.java @@ -63,9 +63,9 @@ public class ConsulPropertySourceTests { assertProperties(source, "fookvval", "8080"); } - private void assertProperties(ConsulPropertySource source, String fooval, String barval) { - assertThat("fooprop was wrong", (String)source.getProperty("fooprop"), is(equalTo(fooval))); - assertThat("bar.prop was wrong", (String)source.getProperty("bar.prop"), is(equalTo(barval))); + private void assertProperties(ConsulPropertySource source, Object fooval, Object barval) { + assertThat("fooprop was wrong", source.getProperty("fooprop"), is(equalTo(fooval))); + assertThat("bar.prop was wrong", source.getProperty("bar.prop"), is(equalTo(barval))); } @Test @@ -91,7 +91,7 @@ public class ConsulPropertySourceTests { configProperties.setFormat(ConsulConfigProperties.Format.YAML); ConsulPropertySource source = getConsulPropertySource(configProperties, yamlContext); - assertProperties(source, "fooymlval", "8080"); + assertProperties(source, "fooymlval", 8080); } private ConsulPropertySource getConsulPropertySource(ConsulConfigProperties configProperties, String context) {