Commit d0ab4e73 by Johannes Edmeier

Set default managemnt-context-path for DefaultServiceInstanceConverter to `actuator`

parent 6e8173ef
......@@ -79,7 +79,7 @@ user.password
| spring.boot.admin.discovery.converter.management-context-path
| Will be appended to the service-url of the discovered service when the management-url is converted by the `DefaultServiceInstanceConverter`.
|
| `/actuator`
| spring.boot.admin.discovery.converter.health-endpoint-path
| Will be appended to the management-url of the discovered service when the health-url is converted by the `DefaultServiceInstanceConverter`.
......
spring:
application:
name: eureka-example
name: spring-boot-admin-sample-eureka
profiles:
active:
- secure
# tag::configuration-eureka[]
eureka: #<1>
instance:
leaseRenewalIntervalInSeconds: 10
health-check-url-path: /actuator/health
client:
registryFetchIntervalSeconds: 5
serviceUrl:
......@@ -16,7 +21,24 @@ management:
web:
exposure:
include: "*" #<2>
# end::configuration-eureka[]
endpoint:
health:
show-details: ALWAYS
# end::configuration-eureka[]
---
spring:
profiles: insecure
---
spring:
profiles: secure
security:
user:
name: "user"
password: "password"
eureka:
instance:
metadata-map:
user.name: "user" #These two are needed so that the server
user.password: "password" #can access the protected client endpoints
......@@ -47,7 +47,7 @@ public class DefaultServiceInstanceConverter implements ServiceInstanceConverter
* Default context-path to be appended to the url of the discovered service for the
* managment-url.
*/
private String managementContextPath = "";
private String managementContextPath = "/actuator";
/**
* Default path of the health-endpoint to be used for the health-url of the discovered service.
*/
......
/*
* Copyright 2014-2017 the original author or authors.
* Copyright 2014-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -35,8 +35,8 @@ public class DefaultServiceInstanceConverterTest {
assertThat(registration.getName()).isEqualTo("test");
assertThat(registration.getServiceUrl()).isEqualTo("http://localhost:80/");
assertThat(registration.getManagementUrl()).isEqualTo("http://localhost:80/");
assertThat(registration.getHealthUrl()).isEqualTo("http://localhost:80/health");
assertThat(registration.getManagementUrl()).isEqualTo("http://localhost:80/actuator");
assertThat(registration.getHealthUrl()).isEqualTo("http://localhost:80/actuator/health");
}
@Test
......
/*
* Copyright 2014-2017 the original author or authors.
* Copyright 2014-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -60,7 +60,7 @@ public class EurekaServiceInstanceConverterTest {
Registration registration = new EurekaServiceInstanceConverter().convert(service);
assertThat(registration.getManagementUrl()).isEqualTo("http://localhost:80/");
assertThat(registration.getManagementUrl()).isEqualTo("http://localhost:80/actuator");
}
@Test
......
......@@ -149,8 +149,8 @@ public class InstanceDiscoveryListenerTest {
StepVerifier.create(registry.getInstances()).assertNext(application -> {
Registration registration = application.getRegistration();
assertThat(registration.getHealthUrl()).isEqualTo("http://localhost:80/health");
assertThat(registration.getManagementUrl()).isEqualTo("http://localhost:80/");
assertThat(registration.getHealthUrl()).isEqualTo("http://localhost:80/actuator/health");
assertThat(registration.getManagementUrl()).isEqualTo("http://localhost:80/actuator");
assertThat(registration.getServiceUrl()).isEqualTo("http://localhost:80/");
assertThat(registration.getName()).isEqualTo("service");
}).verifyComplete();
......
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