Commit e1479a02 authored by Stephane Nicoll's avatar Stephane Nicoll

polish

Use canonical version for the management's context path.
parent 1bf0abc4
...@@ -54,7 +54,7 @@ Example enhanced "/metrics" endpoint with additional "_links": ...@@ -54,7 +54,7 @@ Example enhanced "/metrics" endpoint with additional "_links":
include::{generated}/metrics/hypermedia/http-response.adoc[] include::{generated}/metrics/hypermedia/http-response.adoc[]
WARNING: Beware of Actuator endpoint paths clashing with application endpoints. WARNING: Beware of Actuator endpoint paths clashing with application endpoints.
The easiest way to avoid that is to use a `management.contextPath`, e.g. "/admin". The easiest way to avoid that is to use a `management.context-path`, e.g. "/admin".
TIP: You can disable the hypermedia support in Actuator endpoints by setting TIP: You can disable the hypermedia support in Actuator endpoints by setting
`endpoints.links.enabled=false`. `endpoints.links.enabled=false`.
...@@ -62,13 +62,13 @@ TIP: You can disable the hypermedia support in Actuator endpoints by setting ...@@ -62,13 +62,13 @@ TIP: You can disable the hypermedia support in Actuator endpoints by setting
=== Default home page === Default home page
If the `management.contextPath` is empty, or if the home page provided by the application If the `management.context-path` is empty, or if the home page provided by the application
happens to be a response body of type `ResourceSupport`, then it will be enhanced with happens to be a response body of type `ResourceSupport`, then it will be enhanced with
links to the actuator endpoints. The latter would happen for instance if you use Spring links to the actuator endpoints. The latter would happen for instance if you use Spring
Data REST to expose `Repository` endpoints. Data REST to expose `Repository` endpoints.
Example vanilla "/" endpoint if the `management.contextPath` is empty (the "/admin" page Example vanilla "/" endpoint if the `management.context-path` is empty (the "/admin" page
would be the same with different links if `management.contextPath=/admin`): would be the same with different links if `management.context-path=/admin`):
include::{generated}/admin/http-response.adoc[] include::{generated}/admin/http-response.adoc[]
...@@ -115,10 +115,10 @@ NOTE: if you are using Spring Data REST, then a dependency on the ...@@ -115,10 +115,10 @@ NOTE: if you are using Spring Data REST, then a dependency on the
`spring-data-rest-hal-browser` will have an equivalent effect. `spring-data-rest-hal-browser` will have an equivalent effect.
If you do that then a new endpoint will appear at `/` or `/hal` (relative to the If you do that then a new endpoint will appear at `/` or `/hal` (relative to the
`management.contextPath`) serving up a static HTML page with some JavaScript that lets you `management.context-path`) serving up a static HTML page with some JavaScript that lets you
browse the available resources. The default endpoint path depends on whether or not there browse the available resources. The default endpoint path depends on whether or not there
is already a static home page ("`index.html`") - if there is not and the is already a static home page ("`index.html`") - if there is not and the
`management.contextPath` is empty, then the HAL browser shows up on the home page. `management.context-path` is empty, then the HAL browser shows up on the home page.
Example: Example:
...@@ -155,7 +155,7 @@ or in Gradle ...@@ -155,7 +155,7 @@ or in Gradle
---- ----
If you do that then a new endpoint at `/` or `/docs` (relative to the If you do that then a new endpoint at `/` or `/docs` (relative to the
`management.contextPath`) will serve up a static HTML page with this documentation in it. `management.context-path`) will serve up a static HTML page with this documentation in it.
The default endpoint path depends on whether or not there is already a static home page The default endpoint path depends on whether or not there is already a static home page
("index.html" or a HAL browser) - if there is not and the `management.contextPath` is ("index.html" or a HAL browser) - if there is not and the `management.context-path` is
empty, then the docs browser shows up on the home page. empty, then the docs browser shows up on the home page.
# management.contextPath=/admin # management.context-path=/admin
logging.path: target/logs logging.path: target/logs
\ No newline at end of file
...@@ -44,7 +44,7 @@ import static org.junit.Assert.assertTrue; ...@@ -44,7 +44,7 @@ import static org.junit.Assert.assertTrue;
@SpringApplicationConfiguration(classes = SampleActuatorApplication.class) @SpringApplicationConfiguration(classes = SampleActuatorApplication.class)
@WebAppConfiguration @WebAppConfiguration
@IntegrationTest({ "server.port=0", "management.port=0", "management.address=127.0.0.1", @IntegrationTest({ "server.port=0", "management.port=0", "management.address=127.0.0.1",
"management.contextPath:/admin" }) "management.context-path:/admin" })
@DirtiesContext @DirtiesContext
public class ManagementAddressActuatorApplicationTests { public class ManagementAddressActuatorApplicationTests {
......
error.path: /oops error.path: /oops
management.contextPath: /admin management.context-path: /admin
endpoints.health.sensitive: false endpoints.health.sensitive: false
\ No newline at end of file
# management.contextPath=/admin # management.context-path=/admin
spring.http.converters.preferred-json-mapper: gson spring.http.converters.preferred-json-mapper: gson
\ No newline at end of file
management.contextPath=/admin management.context-path=/admin
endpoints.docs.curies.enabled=true endpoints.docs.curies.enabled=true
\ No newline at end of file
...@@ -40,7 +40,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. ...@@ -40,7 +40,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@WebAppConfiguration @WebAppConfiguration
@SpringApplicationConfiguration(classes = SampleHypermediaJpaApplication.class) @SpringApplicationConfiguration(classes = SampleHypermediaJpaApplication.class)
@DirtiesContext @DirtiesContext
@TestPropertySource(properties = { "debug=true", "management.contextPath=", @TestPropertySource(properties = { "debug=true", "management.context-path=",
"endpoints.docs.curies.enabled=false" }) "endpoints.docs.curies.enabled=false" })
public class SampleHypermediaJpaApplicationCustomLinksPathIntegrationTests { public class SampleHypermediaJpaApplicationCustomLinksPathIntegrationTests {
......
...@@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. ...@@ -41,7 +41,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@SpringApplicationConfiguration(classes = SampleHypermediaJpaApplication.class) @SpringApplicationConfiguration(classes = SampleHypermediaJpaApplication.class)
@DirtiesContext @DirtiesContext
@TestPropertySource(properties = { "endpoints.links.path=/admin", @TestPropertySource(properties = { "endpoints.links.path=/admin",
"management.contextPath=", "endpoints.docs.curies.enabled=false" }) "management.context-path=", "endpoints.docs.curies.enabled=false" })
public class SampleHypermediaJpaApplicationSharedRootIntegrationTests { public class SampleHypermediaJpaApplicationSharedRootIntegrationTests {
@Autowired @Autowired
......
management.contextPath=/admin management.context-path=/admin
\ No newline at end of file \ No newline at end of file
...@@ -39,7 +39,7 @@ import static org.junit.Assert.assertTrue; ...@@ -39,7 +39,7 @@ import static org.junit.Assert.assertTrue;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = SampleHypermediaUiApplication.class) @SpringApplicationConfiguration(classes = SampleHypermediaUiApplication.class)
@WebAppConfiguration @WebAppConfiguration
@IntegrationTest({ "management.contextPath=", "server.port=0" }) @IntegrationTest({ "management.context-path=", "server.port=0" })
public class SampleHypermediaUiApplicationTests { public class SampleHypermediaUiApplicationTests {
@Value("${local.server.port}") @Value("${local.server.port}")
......
# management.contextPath=/admin # management.context-path=/admin
endpoints.docs.curies.enabled=true endpoints.docs.curies.enabled=true
\ No newline at end of file
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