Commit 4ace667c by Ryan Baxter Committed by Spencer Gibb

Sets default actuator prefix in Boot 2.0. Fixes #2777 (#2781)

parent 894a462e
......@@ -48,6 +48,11 @@ public class EurekaInstanceConfigBean implements CloudEurekaInstanceConfig, Envi
private InetUtils inetUtils;
/**
* Default prefix for actuator endpoints
*/
private String actuatorPrefix = "/actuator";
/**
* Get the name of the application to be registered with eureka.
*/
private String appname = UNKNOWN;
......@@ -169,7 +174,7 @@ public class EurekaInstanceConfigBean implements CloudEurekaInstanceConfig, Envi
* status of this instance. Users can provide a simple HTML indicating what is the
* current status of the instance.
*/
private String statusPageUrlPath = "/info";
private String statusPageUrlPath = actuatorPrefix + "/info";
/**
* Gets the absolute status page URL path for this instance. The users can provide the
......@@ -213,7 +218,7 @@ public class EurekaInstanceConfigBean implements CloudEurekaInstanceConfig, Envi
* instance - for example, it can be used to determine whether to proceed deployments
* to an entire farm or stop the deployments without causing further damage.
*/
private String healthCheckUrlPath = "/health";
private String healthCheckUrlPath = actuatorPrefix + "/health";
/**
* Gets the absolute health check page URL for this instance. The users can provide
......
......@@ -209,9 +209,9 @@ public class EurekaClientAutoConfigurationTests {
EurekaInstanceConfigBean instance = this.context
.getBean(EurekaInstanceConfigBean.class);
assertTrue("Wrong status page: " + instance.getStatusPageUrl(),
instance.getStatusPageUrl().endsWith(":9999/info"));
instance.getStatusPageUrl().endsWith(":9999/actuator/info"));
assertTrue("Wrong health check: " + instance.getHealthCheckUrl(),
instance.getHealthCheckUrl().endsWith(":9999/health"));
instance.getHealthCheckUrl().endsWith(":9999/actuator/health"));
}
@Test
......@@ -223,9 +223,9 @@ public class EurekaClientAutoConfigurationTests {
EurekaInstanceConfigBean instance = this.context
.getBean(EurekaInstanceConfigBean.class);
assertTrue("Wrong status page: " + instance.getStatusPageUrl(),
instance.getStatusPageUrl().endsWith(":8989/management/info"));
instance.getStatusPageUrl().endsWith(":8989/management/actuator/info"));
assertTrue("Wrong health check: " + instance.getHealthCheckUrl(),
instance.getHealthCheckUrl().endsWith(":8989/management/health"));
instance.getHealthCheckUrl().endsWith(":8989/management/actuator/health"));
}
@Test
......@@ -298,9 +298,9 @@ public class EurekaClientAutoConfigurationTests {
EurekaInstanceConfigBean instance = this.context
.getBean(EurekaInstanceConfigBean.class);
assertEquals("statusPageUrl is wrong", "http://" + instance.getIpAddress() + ":9999/info",
assertEquals("statusPageUrl is wrong", "http://" + instance.getIpAddress() + ":9999/actuator/info",
instance.getStatusPageUrl());
assertEquals("healthCheckUrl is wrong", "http://" + instance.getIpAddress() + ":9999/health",
assertEquals("healthCheckUrl is wrong", "http://" + instance.getIpAddress() + ":9999/actuator/health",
instance.getHealthCheckUrl());
}
......@@ -315,9 +315,9 @@ public class EurekaClientAutoConfigurationTests {
EurekaInstanceConfigBean instance = this.context
.getBean(EurekaInstanceConfigBean.class);
assertEquals("statusPageUrl is wrong", "http://192.168.13.90:9999/info",
assertEquals("statusPageUrl is wrong", "http://192.168.13.90:9999/actuator/info",
instance.getStatusPageUrl());
assertEquals("healthCheckUrl is wrong", "http://192.168.13.90:9999/health",
assertEquals("healthCheckUrl is wrong", "http://192.168.13.90:9999/actuator/health",
instance.getHealthCheckUrl());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment