[bs-143] Add LiveBeansView to Actuator app on /beans
As per standard LiveBeansView features, if spring.liveBeansView.mbeanDomain is set in the Environment, then all application contexts are displayed, otherwise only the local one. Only JSON is served (via produces=). [Fixes #50879457]
This commit is contained in:
@@ -128,6 +128,19 @@ public class ServiceBootstrapApplicationTests {
|
||||
assertEquals(999, body.get("status"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBeans() throws Exception {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<List> entity = getRestTemplate("user", "password").getForEntity(
|
||||
"http://localhost:8080/beans", List.class);
|
||||
assertEquals(HttpStatus.OK, entity.getStatusCode());
|
||||
assertEquals(1, entity.getBody().size());
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> body = (Map<String, Object>) entity.getBody().get(0);
|
||||
assertTrue("Wrong body: " + body,
|
||||
((String) body.get("context")).startsWith("org.springframework"));
|
||||
}
|
||||
|
||||
private RestTemplate getRestTemplate() {
|
||||
return getRestTemplate(null, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user