diff --git a/spring-cloud-config-sample/src/test/java/sample/ApplicationTests.java b/spring-cloud-config-sample/src/test/java/sample/ApplicationTests.java index ecde51b8..eb292c12 100644 --- a/spring-cloud-config-sample/src/test/java/sample/ApplicationTests.java +++ b/spring-cloud-config-sample/src/test/java/sample/ApplicationTests.java @@ -65,13 +65,8 @@ public class ApplicationTests { Map res = new TestRestTemplate() .getForObject("http://localhost:" + port + "/application/env/info.foo", Map.class); assertThat(res).containsKey("propertySources"); - List> sources = (List>) res.get("propertySources"); - Optional> properties = sources.stream() - .map(map -> (Map) map.get("properties")) - .filter(map -> map.containsKey("info.foo")) - .map(map -> (Map) map.get("info.foo")) - .findFirst(); - assertThat(properties.get()).containsEntry("value", "bar"); + Map property = (Map) res.get("property"); + assertThat(property).containsEntry("value", "bar"); } public static void main(String[] args) throws IOException {