Move /application to /actuator
Change the endpoint default path from `/application` to `/actuator`. Fixes gh-10970
This commit is contained in:
@@ -61,8 +61,7 @@ public class ManagementAddressActuatorApplicationTests {
|
||||
public void testHealth() throws Exception {
|
||||
ResponseEntity<String> entity = new TestRestTemplate()
|
||||
.withBasicAuth("user", getPassword()).getForEntity("http://localhost:"
|
||||
+ this.managementPort + "/admin/application/health",
|
||||
String.class);
|
||||
+ this.managementPort + "/admin/actuator/health", String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody()).contains("\"status\":\"UP\"");
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class ManagementPortSampleActuatorApplicationTests {
|
||||
testHome(); // makes sure some requests have been made
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = new TestRestTemplate().getForEntity(
|
||||
"http://localhost:" + this.managementPort + "/application/metrics",
|
||||
"http://localhost:" + this.managementPort + "/actuator/metrics",
|
||||
Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class ManagementPortSampleActuatorApplicationTests {
|
||||
public void testHealth() throws Exception {
|
||||
ResponseEntity<String> entity = new TestRestTemplate()
|
||||
.withBasicAuth("user", getPassword()).getForEntity(
|
||||
"http://localhost:" + this.managementPort + "/application/health",
|
||||
"http://localhost:" + this.managementPort + "/actuator/health",
|
||||
String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody()).contains("\"status\":\"UP\"");
|
||||
|
||||
@@ -94,7 +94,7 @@ public class SampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/metrics", Map.class);
|
||||
.getForEntity("/actuator/metrics", Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
Map<String, Object> body = entity.getBody();
|
||||
assertThat(body).containsKey("names");
|
||||
@@ -107,7 +107,7 @@ public class SampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/env", Map.class);
|
||||
.getForEntity("/actuator/env", Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> body = entity.getBody();
|
||||
@@ -118,7 +118,7 @@ public class SampleActuatorApplicationTests {
|
||||
public void testHealth() throws Exception {
|
||||
ResponseEntity<String> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/health", String.class);
|
||||
.getForEntity("/actuator/health", String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody()).contains("\"status\":\"UP\"");
|
||||
assertThat(entity.getBody()).doesNotContain("\"hello\":\"1\"");
|
||||
@@ -128,7 +128,7 @@ public class SampleActuatorApplicationTests {
|
||||
public void testInfo() throws Exception {
|
||||
ResponseEntity<String> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/info", String.class);
|
||||
.getForEntity("/actuator/info", String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody())
|
||||
.contains("\"artifact\":\"spring-boot-sample-actuator\"");
|
||||
@@ -169,7 +169,7 @@ public class SampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/trace", Map.class);
|
||||
.getForEntity("/actuator/trace", Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
Map<String, Object> body = entity.getBody();
|
||||
Map<String, Object> trace = ((List<Map<String, Object>>) body.get("traces"))
|
||||
@@ -183,11 +183,11 @@ public class SampleActuatorApplicationTests {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void traceWithParameterMap() throws Exception {
|
||||
this.restTemplate.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/health?param1=value1", String.class);
|
||||
.getForEntity("/actuator/health?param1=value1", String.class);
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/trace", Map.class);
|
||||
.getForEntity("/actuator/trace", Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
Map<String, Object> body = entity.getBody();
|
||||
Map<String, Object> trace = ((List<Map<String, Object>>) body.get("traces"))
|
||||
@@ -215,7 +215,7 @@ public class SampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/beans", Map.class);
|
||||
.getForEntity("/actuator/beans", Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody()).containsOnlyKeys("beans", "parent", "contextId");
|
||||
assertThat(((String) entity.getBody().get("contextId")))
|
||||
@@ -228,7 +228,7 @@ public class SampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/application/configprops", Map.class);
|
||||
.getForEntity("/actuator/configprops", Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
Map<String, Object> body = entity.getBody();
|
||||
assertThat((Map<String, Object>) body.get("beans"))
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ServletPathSampleActuatorApplicationTests {
|
||||
public void testHealth() throws Exception {
|
||||
ResponseEntity<String> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.getForEntity("/spring/application/health", String.class);
|
||||
.getForEntity("/spring/actuator/health", String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody()).contains("\"status\":\"UP\"");
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ShutdownSampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = this.restTemplate
|
||||
.withBasicAuth("user", getPassword())
|
||||
.postForEntity("/application/shutdown", null, Map.class);
|
||||
.postForEntity("/actuator/shutdown", null, Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> body = entity.getBody();
|
||||
|
||||
Reference in New Issue
Block a user