[bs-148] Add /env endpoint for Spring Environment
Any enumerable property source is enumerated. Plus all
properties are available through /env/{name}.
[Fixes #51141441]
This commit is contained in:
@@ -97,6 +97,28 @@ public class ServiceBootstrapApplicationTests {
|
||||
assertTrue("Wrong body: " + body, body.containsKey("counter.status.200.root"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnv() throws Exception {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = getRestTemplate("user", "password").getForEntity(
|
||||
"http://localhost:8080/env", Map.class);
|
||||
assertEquals(HttpStatus.OK, entity.getStatusCode());
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> body = entity.getBody();
|
||||
assertTrue("Wrong body: " + body, body.containsKey("systemProperties"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnvProperty() throws Exception {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = getRestTemplate("user", "password").getForEntity(
|
||||
"http://localhost:8080/env/logging.file", Map.class);
|
||||
assertEquals(HttpStatus.OK, entity.getStatusCode());
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> body = entity.getBody();
|
||||
assertEquals("{logging.file=/tmp/logs/app.log}", body.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHealth() throws Exception {
|
||||
ResponseEntity<String> entity = getRestTemplate().getForEntity(
|
||||
|
||||
Reference in New Issue
Block a user