Prevent empty json for parameters in trace endpoint
Fixes gh-8883
This commit is contained in:
@@ -187,6 +187,22 @@ public class SampleActuatorApplicationTests {
|
||||
assertThat(map.get("status")).isEqualTo("200");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void traceWithParameterMap() throws Exception {
|
||||
this.restTemplate.getForEntity("/health?param1=value1", String.class);
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<List> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword()).getForEntity("/trace", List.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Map<String, Object>> list = entity.getBody();
|
||||
Map<String, Object> trace = list.get(0);
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> map = (Map<String, Object>) ((Map<String, Object>)trace
|
||||
.get("info")).get("parameters");
|
||||
assertThat(map.get("param1")).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testErrorPageDirectAccess() throws Exception {
|
||||
@SuppressWarnings("rawtypes")
|
||||
|
||||
Reference in New Issue
Block a user