Reflect context hierarchy in beans endpoint’s response structure

Closes gh-10156
This commit is contained in:
Andy Wilkinson
2017-09-05 10:38:08 +01:00
parent ab54801143
commit a6b30a3aab
3 changed files with 58 additions and 79 deletions

View File

@@ -217,10 +217,8 @@ public class SampleActuatorApplicationTests {
.withBasicAuth("user", getPassword())
.getForEntity("/application/beans", Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).hasSize(1);
Map<String, Object> body = (Map<String, Object>) ((List<?>) entity.getBody()
.get("contexts")).get(0);
assertThat(((String) body.get("id"))).startsWith("application");
assertThat(entity.getBody()).containsOnlyKeys("beans", "parent", "id");
assertThat(((String) entity.getBody().get("id"))).startsWith("application");
}
@SuppressWarnings("unchecked")