Move `/application` to `/actuator`

Change the endpoint default path from `/application` to `/actuator`.

Fixes gh-10970
pull/11117/merge
Phillip Webb 7 years ago
parent 3e2ede51d6
commit 07f71e889e

@ -8,7 +8,7 @@ The `auditevents` endpoint provides information about the application's audit ev
[[audit-events-retrieving]]
== Retrieving Audit Events
To retrieve the audit events, make a `GET` request to `/application/auditevents`, as shown
To retrieve the audit events, make a `GET` request to `/actuator/auditevents`, as shown
in the following curl-based example:
include::{snippets}auditevents/filtered/curl-request.adoc[]

@ -8,7 +8,7 @@ The `beans` endpoint provides information about the application's beans.
[[beans-retrieving]]
== Retrieving the Beans
To retrieve the beans, make a `GET` request to `/application/beans`, as shown in the
To retrieve the beans, make a `GET` request to `/actuator/beans`, as shown in the
following curl-based example:
include::{snippets}beans/curl-request.adoc[]

@ -9,7 +9,7 @@ configuration and auto-configuration classes.
[[conditions-retrieving]]
== Retrieving the Report
To retrieve the report, make a `GET` request to `/application/conditions`, as shown in
To retrieve the report, make a `GET` request to `/actuator/conditions`, as shown in
the following curl-based example:
include::{snippets}conditions/curl-request.adoc[]

@ -10,7 +10,7 @@ The `configprops` endpoint provides information about the application's
== Retrieving the `@ConfigurationProperties` Bean
To retrieve the `@ConfigurationProperties` beans, make a `GET` request to
`/application/configprops`, as shown in the following curl-based example:
`/actuator/configprops`, as shown in the following curl-based example:
include::{snippets}configprops/curl-request.adoc[]

@ -8,7 +8,7 @@ The `env` endpoint provides information about the application's `Environment`.
[[env-entire]]
== Retrieving the Entire Environment
To retrieve the entire environment, make a `GET` request to `/application/env`, as shown in
To retrieve the entire environment, make a `GET` request to `/actuator/env`, as shown in
the following curl-based example:
include::{snippets}env/all/curl-request.adoc[]
@ -33,7 +33,7 @@ include::{snippets}env/all/response-fields.adoc[]
[[env-single-property]]
== Retrieving a Single Property
To retrieve a single property, make a `GET` request to `/application/env/{property.name}`,
To retrieve a single property, make a `GET` request to `/actuator/env/{property.name}`,
as shown in the following curl-based example:
include::{snippets}env/single/curl-request.adoc[]

@ -8,7 +8,7 @@ The `flyway` endpoint provides information about database migrations performed b
[[flyway-retrieving]]
== Retrieving the Migrations
To retrieve the migrations, make a `GET` request to `/application/flyway`, as shown in the
To retrieve the migrations, make a `GET` request to `/actuator/flyway`, as shown in the
following curl-based example:
include::{snippets}flyway/curl-request.adoc[]

@ -8,7 +8,7 @@ The `health` endpoint provides detailed information about the health of the appl
[[health-retrieving]]
== Retrieving the Health
To retrieve the health of the application, make a `GET` request to `/application/health`,
To retrieve the health of the application, make a `GET` request to `/actuator/health`,
as shown in the following curl-based example:
include::{snippets}health/curl-request.adoc[]

@ -8,7 +8,7 @@ The `heapdump` endpoint provides a heap dump from the application's JVM.
[[heapdump-retrieving]]
== Retrieving the Heap Dump
To retrieve the heap dump, make a `GET` request to `/application/heapdump`. The response
To retrieve the heap dump, make a `GET` request to `/actuator/heapdump`. The response
is binary data in https://docs.oracle.com/javase/8/docs/technotes/samples/hprof.html[
HPROF] format and can be large. Typically, you should save the response to disk for
subsequent analysis. When using curl, this can be achieved by using the `-O` option,

@ -9,7 +9,7 @@ The `info` endpoint provides general information about the application.
== Retrieving the Info
To retrieve the information about the application, make a `GET` request to
`/application/info`, as shown in the following curl-based example:
`/actuator/info`, as shown in the following curl-based example:
include::{snippets}info/curl-request.adoc[]

@ -9,7 +9,7 @@ Liquibase.
[[liquibase-retrieving]]
== Retrieving the Changes
To retrieve the changes, make a `GET` request to `/application/liquibase`, as shown in the
To retrieve the changes, make a `GET` request to `/actuator/liquibase`, as shown in the
following curl-based example:
include::{snippets}liquibase/curl-request.adoc[]

@ -8,7 +8,7 @@ The `logfile` endpoint provides access to the contents of the application's log
[[logfile-retrieving]]
== Retrieving the Log File
To retrieve the log file, make a `GET` request to `/application/logfile`, as shown in the
To retrieve the log file, make a `GET` request to `/actuator/logfile`, as shown in the
following curl-based example:
include::{snippets}logfile/entire/curl-request.adoc[]
@ -24,7 +24,7 @@ include::{snippets}logfile/entire/http-response.adoc[]
NOTE: Retrieving part of the log file is not supported when using Jersey.
To retrieve part of the log file, make a `GET` request to `/application/logfile` by using
To retrieve part of the log file, make a `GET` request to `/actuator/logfile` by using
the `Range` header, as shown in the following curl-based example:
include::{snippets}logfile/range/curl-request.adoc[]

@ -9,7 +9,7 @@ of their levels.
[[loggers-all]]
== Retrieving All Loggers
To retrieve the application's loggers, make a `GET` request to `/application/loggers`, as
To retrieve the application's loggers, make a `GET` request to `/actuator/loggers`, as
shown in the following curl-based example:
include::{snippets}loggers/all/curl-request.adoc[]
@ -34,7 +34,7 @@ include::{snippets}loggers/all/response-fields.adoc[]
[[loggers-single]]
== Retrieving a Single Logger
To retrieve a single logger, make a `GET` request to `/application/loggers/{logger.name}`,
To retrieve a single logger, make a `GET` request to `/actuator/loggers/{logger.name}`,
as shown in the following curl-based example:
include::{snippets}loggers/single/curl-request.adoc[]
@ -61,7 +61,7 @@ include::{snippets}loggers/single/response-fields.adoc[]
== Setting a Log Level
To set the level of a logger, make a `POST` request to
`/application/loggers/{logger.name}` with a JSON body that specifies the configured level
`/actuator/loggers/{logger.name}` with a JSON body that specifies the configured level
for the logger, as shown in the following curl-based example:
include::{snippets}loggers/set/curl-request.adoc[]
@ -85,7 +85,7 @@ include::{snippets}loggers/set/request-fields.adoc[]
== Clearing a Log Level
To clear the level of a logger, make a `POST` request to
`/application/loggers/{logger.name}` with a JSON body containing an empty object, as shown
`/actuator/loggers/{logger.name}` with a JSON body containing an empty object, as shown
in the following curl-based example:
include::{snippets}loggers/clear/curl-request.adoc[]

@ -9,7 +9,7 @@ The `metrics` endpoint provides access to application metrics.
== Retrieving Metric Names
To retrieve the names of the available metrics, make a `GET` request to
`/application/metrics`, as shown in the following curl-based example:
`/actuator/metrics`, as shown in the following curl-based example:
include::{snippets}metrics/names/curl-request.adoc[]
@ -33,7 +33,7 @@ include::{snippets}metrics/names/response-fields.adoc[]
[[metrics-retrieving-metric]]
== Retrieving a Metric
To retrieve a metric, make a `GET` request to `/application/metrics/{metric.name}`, as
To retrieve a metric, make a `GET` request to `/actuator/metrics/{metric.name}`, as
shown in the following curl-based example:
include::{snippets}metrics/metric/curl-request.adoc[]
@ -68,7 +68,7 @@ include::{snippets}metrics/metric/response-fields.adoc[]
[[metrics-drilling-down]]
== Drilling Down
To drill down into a metric, make a `GET` request to `/application/metrics/{metric.name}`
To drill down into a metric, make a `GET` request to `/actuator/metrics/{metric.name}`
using the `tag` query parameter, as shown in the following curl-based example:
include::{snippets}metrics/metric-with-tags/curl-request.adoc[]

@ -9,7 +9,7 @@ required for scraping by a Prometheus server.
[[prometheus-retrieving]]
== Retrieving the Metrics
To retrieve the metrics, make a `GET` request to `/application/prometheus`, as shown in
To retrieve the metrics, make a `GET` request to `/actuator/prometheus`, as shown in
the following curl-based example:
include::{snippets}prometheus/curl-request.adoc[]

@ -9,7 +9,7 @@ tasks.
[[scheduled-tasks-retrieving]]
== Retrieving the Scheduled Tasks
To retrieve the scheduled tasks, make a `GET` request to `/application/scheduledtasks`,
To retrieve the scheduled tasks, make a `GET` request to `/actuator/scheduledtasks`,
as shown in the following curl-based example:
include::{snippets}scheduled-tasks/curl-request.adoc[]

@ -9,7 +9,7 @@ are managed by Spring Session.
[[sessions-retrieving]]
== Retrieving Sessions
To retrieve the sessions, make a `GET` request to `/application/sessions`, as shown in the
To retrieve the sessions, make a `GET` request to `/actuator/sessions`, as shown in the
following curl-based example:
include::{snippets}sessions/username/curl-request.adoc[]
@ -48,7 +48,7 @@ include::{snippets}sessions/username/response-fields.adoc[]
[[sessions-retrieving-id]]
== Retrieving a Single Session
To retrieve a single session, make a `GET` request to `/application/sessions/{id}`, as
To retrieve a single session, make a `GET` request to `/actuator/sessions/{id}`, as
shown in the following curl-based example:
include::{snippets}sessions/id/curl-request.adoc[]
@ -75,7 +75,7 @@ include::{snippets}sessions/id/response-fields.adoc[]
[[sessions-deleting]]
== Deleting a Session
To delete a session, make a `DELETE` request to `/application/sessions/{id}`, as shown in
To delete a session, make a `DELETE` request to `/actuator/sessions/{id}`, as shown in
the following curl-based example:
include::{snippets}sessions/delete/curl-request.adoc[]

@ -8,7 +8,7 @@ The `shutdown` endpoint is used to shut down the application.
[[shutdown-shutting-down]]
== Shutting Down the Application
To shut down the application, make a `POST` request to `/application/shutdown`, as shown
To shut down the application, make a `POST` request to `/actuator/shutdown`, as shown
in the following curl-based example:
include::{snippets}shutdown/curl-request.adoc[]

@ -8,7 +8,7 @@ The `threaddump` endpoint provides a thread dump from the application's JVM.
[[threaddump-retrieving]]
== Retrieving the Thread Dump
To retrieve the thread dump, make a `GET` request to `/application/threaddump`, as shown
To retrieve the thread dump, make a `GET` request to `/actuator/threaddump`, as shown
in the following curl-based example:
include::{snippets}threaddump/curl-request.adoc[]

@ -25,8 +25,8 @@ Before you proceed, you should read the following topics:
[[overview-endpoint-urls]]
=== URLs
By default, all web endpoints are available beneath the path `/application` with URLs of
the form `/application/{id}`. The `/application` base path can be configured by using the
By default, all web endpoints are available beneath the path `/actuator` with URLs of
the form `/actuator/{id}`. The `/actuator` base path can be configured by using the
`management.endpoints.web.base-path` property, as shown in the following example:
[source,properties,indent=0]
@ -35,7 +35,7 @@ the form `/application/{id}`. The `/application` base path can be configured by
----
The preceding `application.properties` example changes the form of the endpoint URLs from
`/application/{id}` to `/manage/{id}`. For example, the URL `info` endpoint would become
`/actuator/{id}` to `/manage/{id}`. For example, the URL `info` endpoint would become
`/manage/info`.

@ -38,7 +38,7 @@ public class WebEndpointProperties {
* Base path for Web endpoints. Relative to server.context-path or
* management.server.context-path if management.server.port is configured.
*/
private String basePath = "/application";
private String basePath = "/actuator";
/**
* Endpoint IDs that should be exposed or '*' for all.

@ -56,9 +56,8 @@ public class DefaultEndpointPathProviderTests {
@Test
public void getPathsWhenHasContextPathShouldReturnAllPathsWithContext()
throws Exception {
DefaultEndpointPathProvider provider = createProvider("/application");
assertThat(provider.getPaths()).containsOnly("/application/foo",
"/application/bar");
DefaultEndpointPathProvider provider = createProvider("/actuator");
assertThat(provider.getPaths()).containsOnly("/actuator/foo", "/actuator/bar");
}
@Test
@ -75,8 +74,8 @@ public class DefaultEndpointPathProviderTests {
@Test
public void getPathWhenHasContextPathReturnPath() throws Exception {
DefaultEndpointPathProvider provider = createProvider("/application");
assertThat(provider.getPath("foo")).isEqualTo("/application/foo");
DefaultEndpointPathProvider provider = createProvider("/actuator");
assertThat(provider.getPath("foo")).isEqualTo("/actuator/foo");
}
private DefaultEndpointPathProvider createProvider(String contextPath) {

@ -30,7 +30,7 @@ public class WebEndpointPropertiesTests {
@Test
public void defaultBasePathShouldBeApplication() throws Exception {
WebEndpointProperties properties = new WebEndpointProperties();
assertThat(properties.getBasePath()).isEqualTo("/application");
assertThat(properties.getBasePath()).isEqualTo("/actuator");
}
@Test

@ -60,8 +60,7 @@ public class AuditEventsEndpointDocumentationTests
String queryTimestamp = "2017-11-07T09:37Z";
given(this.repository.find(any(), any(), any())).willReturn(
Arrays.asList(new AuditEvent("alice", "logout", Collections.emptyMap())));
this.mockMvc
.perform(get("/application/auditevents").param("after", queryTimestamp))
this.mockMvc.perform(get("/actuator/auditevents").param("after", queryTimestamp))
.andExpect(status().isOk())
.andDo(document("auditevents/after", responseFields(
fieldWithPath("events").description("An array of audit events."),
@ -81,7 +80,7 @@ public class AuditEventsEndpointDocumentationTests
given(this.repository.find("alice", date, "logout")).willReturn(
Arrays.asList(new AuditEvent("alice", "logout", Collections.emptyMap())));
this.mockMvc
.perform(get("/application/auditevents").param("principal", "alice")
.perform(get("/actuator/auditevents").param("principal", "alice")
.param("after", queryTimestamp).param("type", "logout"))
.andExpect(status().isOk())
.andDo(document("auditevents/filtered",

@ -69,7 +69,7 @@ public class BeansEndpointDocumentationTests extends AbstractEndpointDocumentati
.description("Beans in the parent application "
+ "context, if any.")
.type(JsonFieldType.OBJECT).optional());
this.mockMvc.perform(get("/application/beans")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/beans")).andExpect(status().isOk())
.andDo(document("beans",
preprocessResponse(limit("beans", this::isIndependentBean)),
responseFields));

@ -70,7 +70,7 @@ public class ConditionsReportEndpointDocumentationTests
@Test
public void conditions() throws Exception {
this.mockMvc.perform(get("/application/conditions")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/conditions")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("conditions",
preprocessResponse(limit("positiveMatches"),
limit("negativeMatches")),

@ -43,7 +43,7 @@ public class ConfigurationPropertiesReportEndpointDocumentationTests
@Test
public void configProps() throws Exception {
this.mockMvc.perform(get("/application/configprops")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/configprops")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("configprops",
preprocessResponse(limit("beans")),
responseFields(

@ -71,7 +71,7 @@ public class EnvironmentEndpointDocumentationTests
@Test
public void env() throws Exception {
this.mockMvc.perform(get("/application/env")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/env")).andExpect(status().isOk())
.andDo(document("env/all",
preprocessResponse(replacePattern(
Pattern.compile(
@ -91,7 +91,7 @@ public class EnvironmentEndpointDocumentationTests
@Test
public void singlePropertyFromEnv() throws Exception {
this.mockMvc.perform(get("/application/env/com.example.cache.max-size"))
this.mockMvc.perform(get("/actuator/env/com.example.cache.max-size"))
.andExpect(status().isOk())
.andDo(document("env/single",
preprocessResponse(replacePattern(

@ -50,7 +50,7 @@ public class FlywayEndpointDocumentationTests extends AbstractEndpointDocumentat
@Test
public void flyway() throws Exception {
this.mockMvc.perform(get("/application/flyway")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/flyway")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("flyway",
responseFields(fieldWithPath("*.migrations").description(
"Migrations performed by the Flyway instance, keyed by"

@ -51,7 +51,7 @@ public class HealthEndpointDocumentationTests extends AbstractEndpointDocumentat
@Test
public void health() throws Exception {
this.mockMvc.perform(get("/application/health")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/health")).andExpect(status().isOk())
.andDo(document("health",
responseFields(
fieldWithPath("status").description(

@ -44,7 +44,7 @@ public class HeapDumpWebEndpointDocumentationTests
@Test
public void heapDump() throws Exception {
this.mockMvc.perform(get("/application/heapdump")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/heapdump")).andExpect(status().isOk())
.andDo(document("heapdump",
new CurlRequestSnippet(CliDocumentation.multiLineFormat()) {

@ -48,7 +48,7 @@ public class InfoEndpointDocumentationTests extends AbstractEndpointDocumentatio
@Test
public void info() throws Exception {
this.mockMvc.perform(get("/application/info")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/info")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("info",
responseFields(beneathPath("git"),
fieldWithPath("branch")

@ -48,7 +48,7 @@ public class LiquibaseEndpointDocumentationTests
@Test
public void liquibase() throws Exception {
this.mockMvc.perform(get("/application/liquibase")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/liquibase")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("liquibase",
responseFields(fieldWithPath("*.changeSets").description(
"Change sets made by the Liquibase beans, keyed by "

@ -40,13 +40,13 @@ public class LogFileWebEndpointDocumentationTests
@Test
public void logFile() throws Exception {
this.mockMvc.perform(get("/application/logfile")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/logfile")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("logfile/entire"));
}
@Test
public void logFileRange() throws Exception {
this.mockMvc.perform(get("/application/logfile").header("Range", "bytes=0-1023"))
this.mockMvc.perform(get("/actuator/logfile").header("Range", "bytes=0-1023"))
.andExpect(status().isPartialContent())
.andDo(MockMvcRestDocumentation.document("logfile/range"));
}

@ -67,7 +67,7 @@ public class LoggersEndpointDocumentationTests
given(this.loggingSystem.getLoggerConfigurations()).willReturn(Arrays.asList(
new LoggerConfiguration("ROOT", LogLevel.INFO, LogLevel.INFO),
new LoggerConfiguration("com.example", LogLevel.DEBUG, LogLevel.DEBUG)));
this.mockMvc.perform(get("/application/loggers")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/loggers")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("loggers/all",
responseFields(
fieldWithPath("levels").description(
@ -80,7 +80,7 @@ public class LoggersEndpointDocumentationTests
public void logger() throws Exception {
given(this.loggingSystem.getLoggerConfiguration("com.example")).willReturn(
new LoggerConfiguration("com.example", LogLevel.INFO, LogLevel.INFO));
this.mockMvc.perform(get("/application/loggers/com.example"))
this.mockMvc.perform(get("/actuator/loggers/com.example"))
.andExpect(status().isOk()).andDo(MockMvcRestDocumentation
.document("loggers/single", responseFields(levelFields)));
}
@ -88,7 +88,7 @@ public class LoggersEndpointDocumentationTests
@Test
public void setLogLevel() throws Exception {
this.mockMvc
.perform(post("/application/loggers/com.example")
.perform(post("/actuator/loggers/com.example")
.content("{\"configuredLevel\":\"debug\"}")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isNoContent())
@ -104,7 +104,7 @@ public class LoggersEndpointDocumentationTests
@Test
public void clearLogLevel() throws Exception {
this.mockMvc
.perform(post("/application/loggers/com.example").content("{}")
.perform(post("/actuator/loggers/com.example").content("{}")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isNoContent())
.andDo(MockMvcRestDocumentation.document("loggers/clear"));

@ -44,14 +44,14 @@ public class MetricsEndpointDocumentationTests
@Test
public void metricNames() throws Exception {
this.mockMvc.perform(get("/application/metrics")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/metrics")).andExpect(status().isOk())
.andDo(document("metrics/names", responseFields(fieldWithPath("names")
.description("Names of the known metrics."))));
}
@Test
public void metric() throws Exception {
this.mockMvc.perform(get("/application/metrics/jvm.memory.max"))
this.mockMvc.perform(get("/actuator/metrics/jvm.memory.max"))
.andExpect(status().isOk())
.andDo(document("metrics/metric",
responseFields(
@ -74,7 +74,7 @@ public class MetricsEndpointDocumentationTests
@Test
public void metricWithTags() throws Exception {
this.mockMvc
.perform(get("/application/metrics/jvm.memory.max")
.perform(get("/actuator/metrics/jvm.memory.max")
.param("tag", "area:nonheap")
.param("tag", "id:Compressed Class Space"))
.andExpect(status().isOk())

@ -42,7 +42,7 @@ public class PrometheusScrapeEndpointDocumentationTests
@Test
public void prometheus() throws Exception {
this.mockMvc.perform(get("/application/prometheus")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/prometheus")).andExpect(status().isOk())
.andDo(document("prometheus"));
}

@ -48,8 +48,7 @@ public class ScheduledTasksEndpointDocumentationTests
@Test
public void scheduledTasks() throws Exception {
this.mockMvc.perform(get("/application/scheduledtasks"))
.andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/scheduledtasks")).andExpect(status().isOk())
.andDo(document("scheduled-tasks",
preprocessResponse(replacePattern(
Pattern.compile(

@ -92,7 +92,7 @@ public class SessionsEndpointDocumentationTests
given(this.sessionRepository.findByIndexNameAndIndexValue(
FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, "alice"))
.willReturn(sessions);
this.mockMvc.perform(get("/application/sessions").param("username", "alice"))
this.mockMvc.perform(get("/actuator/sessions").param("username", "alice"))
.andExpect(status().isOk())
.andDo(document("sessions/username",
responseFields(fieldWithPath("sessions")
@ -109,14 +109,14 @@ public class SessionsEndpointDocumentationTests
sessions.put(sessionTwo.getId(), sessionTwo);
sessions.put(sessionThree.getId(), sessionThree);
given(this.sessionRepository.findById(sessionTwo.getId())).willReturn(sessionTwo);
this.mockMvc.perform(get("/application/sessions/{id}", sessionTwo.getId()))
this.mockMvc.perform(get("/actuator/sessions/{id}", sessionTwo.getId()))
.andExpect(status().isOk())
.andDo(document("sessions/id", responseFields(sessionFields)));
}
@Test
public void deleteASession() throws Exception {
this.mockMvc.perform(delete("/application/sessions/{id}", sessionTwo.getId()))
this.mockMvc.perform(delete("/actuator/sessions/{id}", sessionTwo.getId()))
.andExpect(status().isNoContent()).andDo(document("sessions/delete"));
verify(this.sessionRepository).deleteById(sessionTwo.getId());
}

@ -43,7 +43,7 @@ public class ShutdownEndpointDocumentationTests
@Test
public void shutdown() throws Exception {
this.mockMvc.perform(post("/application/shutdown")).andExpect(status().isOk())
this.mockMvc.perform(post("/actuator/shutdown")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("shutdown",
responseFields(fieldWithPath("message").description(
"Message describing the result of the request."))));

@ -42,7 +42,7 @@ public class ThreadDumpEndpointDocumentationTests
@Test
public void threadDump() throws Exception {
this.mockMvc.perform(get("/application/threaddump")).andExpect(status().isOk())
this.mockMvc.perform(get("/actuator/threaddump")).andExpect(status().isOk())
.andDo(MockMvcRestDocumentation.document("threaddump",
preprocessResponse(limit("threads")),
responseFields(

@ -70,7 +70,7 @@ public class JolokiaManagementContextConfigurationIntegrationTests {
@Test
public void jolokiaIsExposed() {
ResponseEntity<String> response = this.restTemplate
.getForEntity("/application/jolokia", String.class);
.getForEntity("/actuator/jolokia", String.class);
assertThat(HttpStatus.OK).isEqualTo(response.getStatusCode());
assertThat(response.getBody()).contains("\"agent\"");
assertThat(response.getBody()).contains("\"request\":{\"type\"");
@ -79,7 +79,7 @@ public class JolokiaManagementContextConfigurationIntegrationTests {
@Test
public void search() {
ResponseEntity<String> response = this.restTemplate
.getForEntity("/application/jolokia/search/java.lang:*", String.class);
.getForEntity("/actuator/jolokia/search/java.lang:*", String.class);
assertThat(HttpStatus.OK).isEqualTo(response.getStatusCode());
assertThat(response.getBody()).contains("GarbageCollector");
}
@ -87,7 +87,7 @@ public class JolokiaManagementContextConfigurationIntegrationTests {
@Test
public void read() {
ResponseEntity<String> response = this.restTemplate.getForEntity(
"/application/jolokia/read/java.lang:type=Memory", String.class);
"/actuator/jolokia/read/java.lang:type=Memory", String.class);
assertThat(HttpStatus.OK).isEqualTo(response.getStatusCode());
assertThat(response.getBody()).contains("NonHeapMemoryUsage");
}
@ -95,7 +95,7 @@ public class JolokiaManagementContextConfigurationIntegrationTests {
@Test
public void list() {
ResponseEntity<String> response = this.restTemplate.getForEntity(
"/application/jolokia/list/java.lang/type=Memory/attr", String.class);
"/actuator/jolokia/list/java.lang/type=Memory/attr", String.class);
assertThat(HttpStatus.OK).isEqualTo(response.getStatusCode());
assertThat(response.getBody()).contains("NonHeapMemoryUsage");
}

@ -78,7 +78,7 @@ public class WebMvcEndpointCorsIntegrationTests {
MockMvc mockMvc = createMockMvc();
System.out.println(new ConditionEvaluationReportMessage(
this.context.getBean(ConditionEvaluationReport.class)));
mockMvc.perform(options("/application/beans").header("Origin", "foo.example.com")
mockMvc.perform(options("/actuator/beans").header("Origin", "foo.example.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET")).andExpect(
header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@ -89,7 +89,7 @@ public class WebMvcEndpointCorsIntegrationTests {
.of("management.endpoints.web.cors.allowed-origins:foo.example.com")
.applyTo(this.context);
createMockMvc()
.perform(options("/application/beans").header("Origin", "bar.example.com")
.perform(options("/actuator/beans").header("Origin", "bar.example.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET"))
.andExpect(status().isForbidden());
performAcceptedCorsRequest();
@ -120,7 +120,7 @@ public class WebMvcEndpointCorsIntegrationTests {
.of("management.endpoints.web.cors.allowed-origins:foo.example.com")
.applyTo(this.context);
createMockMvc()
.perform(options("/application/beans").header("Origin", "foo.example.com")
.perform(options("/actuator/beans").header("Origin", "foo.example.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Alpha"))
.andExpect(status().isForbidden());
@ -133,7 +133,7 @@ public class WebMvcEndpointCorsIntegrationTests {
"management.endpoints.web.cors.allowed-headers:Alpha,Bravo")
.applyTo(this.context);
createMockMvc()
.perform(options("/application/beans").header("Origin", "foo.example.com")
.perform(options("/actuator/beans").header("Origin", "foo.example.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS, "Alpha"))
.andExpect(status().isOk()).andExpect(header()
@ -146,7 +146,7 @@ public class WebMvcEndpointCorsIntegrationTests {
.of("management.endpoints.web.cors.allowed-origins:foo.example.com")
.applyTo(this.context);
createMockMvc()
.perform(options("/application/health")
.perform(options("/actuator/health")
.header(HttpHeaders.ORIGIN, "foo.example.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "PATCH"))
.andExpect(status().isForbidden());
@ -159,7 +159,7 @@ public class WebMvcEndpointCorsIntegrationTests {
"management.endpoints.web.cors.allowed-methods:GET,HEAD")
.applyTo(this.context);
createMockMvc()
.perform(options("/application/beans")
.perform(options("/actuator/beans")
.header(HttpHeaders.ORIGIN, "foo.example.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "HEAD"))
.andExpect(status().isOk()).andExpect(header()
@ -192,7 +192,7 @@ public class WebMvcEndpointCorsIntegrationTests {
}
private ResultActions performAcceptedCorsRequest() throws Exception {
return performAcceptedCorsRequest("/application/beans");
return performAcceptedCorsRequest("/actuator/beans");
}
private ResultActions performAcceptedCorsRequest(String url) throws Exception {

@ -138,7 +138,7 @@ public class WebMvcEndpointExposureIntegrationTests {
private boolean isExposed(MockMvc mockMvc, HttpMethod method, String path)
throws Exception {
path = "/application/" + path;
path = "/actuator/" + path;
MvcResult mvcResult = mockMvc.perform(request(method, path)).andReturn();
int status = mvcResult.getResponse().getStatus();
if (status == HttpStatus.OK.value()) {

@ -70,7 +70,7 @@ public class WebMvcEndpointIntegrationTests {
this.context = new AnnotationConfigWebApplicationContext();
this.context.register(SecureConfiguration.class);
MockMvc mockMvc = createSecureMockMvc();
mockMvc.perform(get("/application/beans").accept(MediaType.APPLICATION_JSON))
mockMvc.perform(get("/actuator/beans").accept(MediaType.APPLICATION_JSON))
.andExpect(status().isUnauthorized());
}

@ -53,7 +53,7 @@ public class JolokiaManagementContextConfigurationTests {
ServletRegistrationBean<?> registrationBean = context
.getBean(ServletRegistrationBean.class);
assertThat(registrationBean.getUrlMappings())
.contains("/application/jolokia/*");
.contains("/actuator/jolokia/*");
assertThat(registrationBean.getInitParameters()).isEmpty();
});
}
@ -69,7 +69,7 @@ public class JolokiaManagementContextConfigurationTests {
this.contextRunner
.withPropertyValues("management.jolokia.enabled=true",
"management.jolokia.path=/lokia")
.run(isDefinedOnPath("/application/lokia/*"));
.run(isDefinedOnPath("/actuator/lokia/*"));
}
@Test

@ -44,53 +44,53 @@ public class EndpointRequestTests {
@Test
public void toAnyEndpointShouldMatchEndpointPath() throws Exception {
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
assertMatcher(matcher).matches("/application/foo");
assertMatcher(matcher).matches("/application/bar");
assertMatcher(matcher).matches("/actuator/foo");
assertMatcher(matcher).matches("/actuator/bar");
}
@Test
public void toAnyEndpointShouldNotMatchOtherPath() throws Exception {
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
assertMatcher(matcher).doesNotMatch("/application/baz");
assertMatcher(matcher).doesNotMatch("/actuator/baz");
}
@Test
public void toEndpointClassShouldMatchEndpointPath() throws Exception {
RequestMatcher matcher = EndpointRequest.to(FooEndpoint.class);
assertMatcher(matcher).matches("/application/foo");
assertMatcher(matcher).matches("/actuator/foo");
}
@Test
public void toEndpointClassShouldNotMatchOtherPath() throws Exception {
RequestMatcher matcher = EndpointRequest.to(FooEndpoint.class);
assertMatcher(matcher).doesNotMatch("/application/bar");
assertMatcher(matcher).doesNotMatch("/actuator/bar");
}
@Test
public void toEndpointIdShouldMatchEndpointPath() throws Exception {
RequestMatcher matcher = EndpointRequest.to("foo");
assertMatcher(matcher).matches("/application/foo");
assertMatcher(matcher).matches("/actuator/foo");
}
@Test
public void toEndpointIdShouldNotMatchOtherPath() throws Exception {
RequestMatcher matcher = EndpointRequest.to("foo");
assertMatcher(matcher).doesNotMatch("/application/bar");
assertMatcher(matcher).doesNotMatch("/actuator/bar");
}
@Test
public void excludeByClassShouldNotMatchExcluded() throws Exception {
RequestMatcher matcher = EndpointRequest.toAnyEndpoint()
.excluding(FooEndpoint.class);
assertMatcher(matcher).doesNotMatch("/application/foo");
assertMatcher(matcher).matches("/application/bar");
assertMatcher(matcher).doesNotMatch("/actuator/foo");
assertMatcher(matcher).matches("/actuator/bar");
}
@Test
public void excludeByIdShouldNotMatchExcluded() throws Exception {
RequestMatcher matcher = EndpointRequest.toAnyEndpoint().excluding("foo");
assertMatcher(matcher).doesNotMatch("/application/foo");
assertMatcher(matcher).matches("/application/bar");
assertMatcher(matcher).doesNotMatch("/actuator/foo");
assertMatcher(matcher).matches("/actuator/bar");
}
private RequestMatcherAssert assertMatcher(RequestMatcher matcher) {
@ -164,16 +164,16 @@ public class EndpointRequestTests {
@Override
public List<String> getPaths() {
return Arrays.asList("/application/foo", "/application/bar");
return Arrays.asList("/actuator/foo", "/actuator/bar");
}
@Override
public String getPath(String id) {
if ("foo".equals(id)) {
return "/application/foo";
return "/actuator/foo";
}
if ("bar".equals(id)) {
return "/application/bar";
return "/actuator/bar";
}
return null;
}

@ -102,12 +102,11 @@ public class RequestMappingEndpointTests {
this.endpoint.setApplicationContext(context);
Map<String, Object> result = this.endpoint.mappings();
assertThat(result).hasSize(2);
assertThat(result.keySet())
.filteredOn((key) -> key.contains("[/application/test]"))
assertThat(result.keySet()).filteredOn((key) -> key.contains("[/actuator/test]"))
.hasOnlyOneElementSatisfying(
(key) -> assertThat((Map<String, Object>) result.get(key))
.containsOnlyKeys("bean", "method"));
assertThat(result.keySet()).filteredOn((key) -> key.contains("[/application]"))
assertThat(result.keySet()).filteredOn((key) -> key.contains("[/actuator]"))
.hasOnlyOneElementSatisfying(
(key) -> assertThat((Map<String, Object>) result.get(key))
.containsOnlyKeys("bean", "method"));
@ -120,12 +119,11 @@ public class RequestMappingEndpointTests {
this.endpoint.setMethodMappings(Collections.singletonList(mapping));
Map<String, Object> result = this.endpoint.mappings();
assertThat(result).hasSize(2);
assertThat(result.keySet())
.filteredOn((key) -> key.contains("[/application/test]"))
assertThat(result.keySet()).filteredOn((key) -> key.contains("[/actuator/test]"))
.hasOnlyOneElementSatisfying(
(key) -> assertThat((Map<String, Object>) result.get(key))
.containsOnlyKeys("method"));
assertThat(result.keySet()).filteredOn((key) -> key.contains("[/application]"))
assertThat(result.keySet()).filteredOn((key) -> key.contains("[/actuator]"))
.hasOnlyOneElementSatisfying(
(key) -> assertThat((Map<String, Object>) result.get(key))
.containsOnlyKeys("method"));
@ -138,7 +136,7 @@ public class RequestMappingEndpointTests {
WebOperation operation = new WebOperation(OperationType.READ,
(arguments) -> "Invoked", true, requestPredicate, "test");
WebMvcEndpointHandlerMapping mapping = new WebMvcEndpointHandlerMapping(
new EndpointMapping("application"),
new EndpointMapping("actuator"),
Collections.singleton(new EndpointInfo<>("test", true,
Collections.singleton(operation))),
new EndpointMediaTypes(Arrays.asList("application/vnd.test+json"),

@ -43,14 +43,14 @@ public class AuditEventsEndpointWebIntegrationTests {
@Test
public void eventsWithoutParams() throws Exception {
client.get().uri((builder) -> builder.path("/application/auditevents").build())
client.get().uri((builder) -> builder.path("/actuator/auditevents").build())
.exchange().expectStatus().isBadRequest();
}
@Test
public void eventsWithDateAfter() throws Exception {
client.get()
.uri((builder) -> builder.path("/application/auditevents")
.uri((builder) -> builder.path("/actuator/auditevents")
.queryParam("after", "2016-11-01T13:00:00%2B00:00").build())
.exchange().expectStatus().isOk().expectBody().jsonPath("events")
.isEmpty();
@ -59,7 +59,7 @@ public class AuditEventsEndpointWebIntegrationTests {
@Test
public void eventsWithPrincipalAndDateAfter() throws Exception {
client.get()
.uri((builder) -> builder.path("/application/auditevents")
.uri((builder) -> builder.path("/actuator/auditevents")
.queryParam("after", "2016-11-01T10:00:00%2B00:00")
.queryParam("principal", "user").build())
.exchange().expectStatus().isOk().expectBody()
@ -70,7 +70,7 @@ public class AuditEventsEndpointWebIntegrationTests {
@Test
public void eventsWithPrincipalDateAfterAndType() throws Exception {
client.get()
.uri((builder) -> builder.path("/application/auditevents")
.uri((builder) -> builder.path("/actuator/auditevents")
.queryParam("after", "2016-11-01T10:00:00%2B00:00")
.queryParam("principal", "admin").queryParam("type", "logout")
.build())

@ -40,19 +40,19 @@ public class EndpointLinksResolverTests {
@Test
public void linkResolutionWithTrailingSlashStripsSlashOnSelfLink() {
Map<String, Link> links = this.linksResolver.resolveLinks(Collections.emptyList(),
"https://api.example.com/application/");
"https://api.example.com/actuator/");
assertThat(links).hasSize(1);
assertThat(links).hasEntrySatisfying("self",
linkWithHref("https://api.example.com/application"));
linkWithHref("https://api.example.com/actuator"));
}
@Test
public void linkResolutionWithoutTrailingSlash() {
Map<String, Link> links = this.linksResolver.resolveLinks(Collections.emptyList(),
"https://api.example.com/application");
"https://api.example.com/actuator");
assertThat(links).hasSize(1);
assertThat(links).hasEntrySatisfying("self",
linkWithHref("https://api.example.com/application"));
linkWithHref("https://api.example.com/actuator"));
}
@Test
@ -63,14 +63,14 @@ public class EndpointLinksResolverTests {
Arrays.asList(operationWithPath("/alpha", "alpha"),
operationWithPath("/alpha/{name}",
"alpha-name")))),
"https://api.example.com/application");
"https://api.example.com/actuator");
assertThat(links).hasSize(3);
assertThat(links).hasEntrySatisfying("self",
linkWithHref("https://api.example.com/application"));
linkWithHref("https://api.example.com/actuator"));
assertThat(links).hasEntrySatisfying("alpha",
linkWithHref("https://api.example.com/application/alpha"));
linkWithHref("https://api.example.com/actuator/alpha"));
assertThat(links).hasEntrySatisfying("alpha-name",
linkWithHref("https://api.example.com/application/alpha/{name}"));
linkWithHref("https://api.example.com/actuator/alpha/{name}"));
}
private WebOperation operationWithPath(String path, String id) {

@ -101,7 +101,7 @@ class JerseyEndpointsRunner extends AbstractWebEndpointRunner {
this.applicationContext, new ConversionServiceParameterMapper(),
endpointMediaTypes, EndpointPathResolver.useEndpointId(), null, null);
Collection<Resource> resources = new JerseyEndpointResourceFactory()
.createEndpointResources(new EndpointMapping("/application"),
.createEndpointResources(new EndpointMapping("/actuator"),
discoverer.discoverEndpoints(), endpointMediaTypes);
config.registerResources(new HashSet<>(resources));
}

@ -106,7 +106,7 @@ class WebFluxEndpointsRunner extends AbstractWebEndpointRunner {
WebAnnotationEndpointDiscoverer discoverer = new WebAnnotationEndpointDiscoverer(
this.applicationContext, new ConversionServiceParameterMapper(),
endpointMediaTypes, EndpointPathResolver.useEndpointId(), null, null);
return new WebFluxEndpointHandlerMapping(new EndpointMapping("/application"),
return new WebFluxEndpointHandlerMapping(new EndpointMapping("/actuator"),
discoverer.discoverEndpoints(), endpointMediaTypes,
new CorsConfiguration());
}

@ -89,7 +89,7 @@ class WebMvcEndpointRunner extends AbstractWebEndpointRunner {
WebAnnotationEndpointDiscoverer discoverer = new WebAnnotationEndpointDiscoverer(
this.applicationContext, new ConversionServiceParameterMapper(),
endpointMediaTypes, EndpointPathResolver.useEndpointId(), null, null);
return new WebMvcEndpointHandlerMapping(new EndpointMapping("/application"),
return new WebMvcEndpointHandlerMapping(new EndpointMapping("/actuator"),
discoverer.discoverEndpoints(), endpointMediaTypes,
new CorsConfiguration());
}

@ -46,13 +46,13 @@ public class EnvironmentEndpointWebIntegrationTests {
@Test
public void home() throws Exception {
client.get().uri("/application/env").exchange().expectStatus().isOk().expectBody()
client.get().uri("/actuator/env").exchange().expectStatus().isOk().expectBody()
.jsonPath("propertySources[?(@.name=='systemProperties')]").exists();
}
@Test
public void sub() throws Exception {
client.get().uri("/application/env/foo").exchange().expectStatus().isOk()
client.get().uri("/actuator/env/foo").exchange().expectStatus().isOk()
.expectBody().jsonPath("property.source").isEqualTo("test")
.jsonPath("property.value").isEqualTo("bar");
}
@ -63,8 +63,8 @@ public class EnvironmentEndpointWebIntegrationTests {
map.put("food", null);
EnvironmentEndpointWebIntegrationTests.context.getEnvironment()
.getPropertySources().addFirst(new MapPropertySource("null-value", map));
client.get().uri("/application/env?pattern=foo.*").exchange().expectStatus()
.isOk().expectBody().jsonPath(forProperty("test", "foo")).isEqualTo("bar")
client.get().uri("/actuator/env?pattern=foo.*").exchange().expectStatus().isOk()
.expectBody().jsonPath(forProperty("test", "foo")).isEqualTo("bar")
.jsonPath(forProperty("test", "fool")).isEqualTo("baz");
}
@ -75,7 +75,7 @@ public class EnvironmentEndpointWebIntegrationTests {
map.put("my.foo", "${my.bar}");
context.getEnvironment().getPropertySources()
.addFirst(new MapPropertySource("unresolved-placeholder", map));
client.get().uri("/application/env/my.foo").exchange().expectStatus().isOk()
client.get().uri("/actuator/env/my.foo").exchange().expectStatus().isOk()
.expectBody().jsonPath("property.value").isEqualTo("${my.bar}")
.jsonPath(forPropertyEntry("unresolved-placeholder"))
.isEqualTo("${my.bar}");
@ -88,14 +88,14 @@ public class EnvironmentEndpointWebIntegrationTests {
map.put("my.password", "hello");
context.getEnvironment().getPropertySources()
.addFirst(new MapPropertySource("placeholder", map));
client.get().uri("/application/env/my.foo").exchange().expectStatus().isOk()
client.get().uri("/actuator/env/my.foo").exchange().expectStatus().isOk()
.expectBody().jsonPath("property.value").isEqualTo("******")
.jsonPath(forPropertyEntry("placeholder")).isEqualTo("******");
}
@Test
public void nestedPathForUnknownKeyShouldReturn404AndBody() throws Exception {
client.get().uri("/application/env/this.does.not.exist").exchange().expectStatus()
client.get().uri("/actuator/env/this.does.not.exist").exchange().expectStatus()
.isNotFound().expectBody().jsonPath("property").doesNotExist()
.jsonPath("propertySources[?(@.name=='test')]").exists()
.jsonPath("propertySources[?(@.name=='systemProperties')]").exists()
@ -109,7 +109,7 @@ public class EnvironmentEndpointWebIntegrationTests {
map.put("my.foo", "${my.bar}");
context.getEnvironment().getPropertySources()
.addFirst(new MapPropertySource("unresolved-placeholder", map));
client.get().uri("/application/env?pattern=my.*").exchange().expectStatus().isOk()
client.get().uri("/actuator/env?pattern=my.*").exchange().expectStatus().isOk()
.expectBody()
.jsonPath(
"propertySources[?(@.name=='unresolved-placeholder')].properties.['my.foo'].value")
@ -124,7 +124,7 @@ public class EnvironmentEndpointWebIntegrationTests {
map.put("my.password", "hello");
context.getEnvironment().getPropertySources()
.addFirst(new MapPropertySource("placeholder", map));
client.get().uri("/application/env?pattern=my.*").exchange().expectStatus().isOk()
client.get().uri("/actuator/env?pattern=my.*").exchange().expectStatus().isOk()
.expectBody().jsonPath(forProperty("placeholder", "my.foo"))
.isEqualTo("******");
}

@ -43,17 +43,16 @@ public class HealthEndpointWebIntegrationTests {
@Test
public void whenHealthIsUp200ResponseIsReturned() throws Exception {
client.get().uri("/application/health").exchange().expectStatus().isOk()
.expectBody().jsonPath("status").isEqualTo("UP")
.jsonPath("details.alpha.status").isEqualTo("UP")
.jsonPath("details.bravo.status").isEqualTo("UP");
client.get().uri("/actuator/health").exchange().expectStatus().isOk().expectBody()
.jsonPath("status").isEqualTo("UP").jsonPath("details.alpha.status")
.isEqualTo("UP").jsonPath("details.bravo.status").isEqualTo("UP");
}
@Test
public void whenHealthIsDown503ResponseIsReturned() throws Exception {
context.getBean("alphaHealthIndicator", TestHealthIndicator.class)
.setHealth(Health.down().build());
client.get().uri("/application/health").exchange().expectStatus()
client.get().uri("/actuator/health").exchange().expectStatus()
.isEqualTo(HttpStatus.SERVICE_UNAVAILABLE).expectBody().jsonPath("status")
.isEqualTo("DOWN").jsonPath("details.alpha.status").isEqualTo("DOWN")
.jsonPath("details.bravo.status").isEqualTo("UP");

@ -45,8 +45,8 @@ public class InfoEndpointWebIntegrationTests {
@Test
public void info() throws Exception {
client.get().uri("/application/info").accept(MediaType.APPLICATION_JSON)
.exchange().expectStatus().isOk().expectBody().jsonPath("beanName1.key11")
client.get().uri("/actuator/info").accept(MediaType.APPLICATION_JSON).exchange()
.expectStatus().isOk().expectBody().jsonPath("beanName1.key11")
.isEqualTo("value11").jsonPath("beanName1.key12").isEqualTo("value12")
.jsonPath("beanName2.key21").isEqualTo("value21")
.jsonPath("beanName2.key22").isEqualTo("value22");

@ -60,14 +60,14 @@ public class LogFileWebEndpointWebIntegrationTests {
@Test
public void getRequestProduces404ResponseWhenLogFileNotFound() throws Exception {
client.get().uri("/application/logfile").exchange().expectStatus().isNotFound();
client.get().uri("/actuator/logfile").exchange().expectStatus().isNotFound();
}
@Test
public void getRequestProducesResponseWithLogFile() throws Exception {
TestPropertyValues.of("logging.file:" + this.logFile.getAbsolutePath())
.applyTo(context);
client.get().uri("/application/logfile").exchange().expectStatus().isOk()
client.get().uri("/actuator/logfile").exchange().expectStatus().isOk()
.expectBody(String.class).isEqualTo("--TEST--");
}

@ -75,7 +75,7 @@ public class LoggersEndpointWebIntegrationTests {
public void getLoggerShouldReturnAllLoggerConfigurations() throws Exception {
given(this.loggingSystem.getLoggerConfigurations()).willReturn(Collections
.singletonList(new LoggerConfiguration("ROOT", null, LogLevel.DEBUG)));
client.get().uri("/application/loggers").exchange().expectStatus().isOk()
client.get().uri("/actuator/loggers").exchange().expectStatus().isOk()
.expectBody().jsonPath("$.length()").isEqualTo(2).jsonPath("levels")
.isEqualTo(jsonArrayOf("OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG",
"TRACE"))
@ -89,7 +89,7 @@ public class LoggersEndpointWebIntegrationTests {
public void getLoggerShouldReturnLogLevels() throws Exception {
given(this.loggingSystem.getLoggerConfiguration("ROOT"))
.willReturn(new LoggerConfiguration("ROOT", null, LogLevel.DEBUG));
client.get().uri("/application/loggers/ROOT").exchange().expectStatus().isOk()
client.get().uri("/actuator/loggers/ROOT").exchange().expectStatus().isOk()
.expectBody().jsonPath("$.length()").isEqualTo(2)
.jsonPath("configuredLevel").isEqualTo(null).jsonPath("effectiveLevel")
.isEqualTo("DEBUG");
@ -97,13 +97,13 @@ public class LoggersEndpointWebIntegrationTests {
@Test
public void getLoggersWhenLoggerNotFoundShouldReturnNotFound() throws Exception {
client.get().uri("/application/loggers/com.does.not.exist").exchange()
.expectStatus().isNotFound();
client.get().uri("/actuator/loggers/com.does.not.exist").exchange().expectStatus()
.isNotFound();
}
@Test
public void setLoggerUsingApplicationJsonShouldSetLogLevel() throws Exception {
client.post().uri("/application/loggers/ROOT")
client.post().uri("/actuator/loggers/ROOT")
.contentType(MediaType.APPLICATION_JSON)
.syncBody(Collections.singletonMap("configuredLevel", "debug")).exchange()
.expectStatus().isNoContent();
@ -112,7 +112,7 @@ public class LoggersEndpointWebIntegrationTests {
@Test
public void setLoggerUsingActuatorV2JsonShouldSetLogLevel() throws Exception {
client.post().uri("/application/loggers/ROOT")
client.post().uri("/actuator/loggers/ROOT")
.contentType(MediaType.parseMediaType(ActuatorMediaType.V2_JSON))
.syncBody(Collections.singletonMap("configuredLevel", "debug")).exchange()
.expectStatus().isNoContent();
@ -121,7 +121,7 @@ public class LoggersEndpointWebIntegrationTests {
@Test
public void setLoggerWithWrongLogLevelResultInBadRequestResponse() throws Exception {
client.post().uri("/application/loggers/ROOT")
client.post().uri("/actuator/loggers/ROOT")
.contentType(MediaType.APPLICATION_JSON)
.syncBody(Collections.singletonMap("configuredLevel", "other")).exchange()
.expectStatus().isBadRequest();
@ -130,7 +130,7 @@ public class LoggersEndpointWebIntegrationTests {
@Test
public void setLoggerWithNullLogLevel() throws Exception {
client.post().uri("/application/loggers/ROOT")
client.post().uri("/actuator/loggers/ROOT")
.contentType(MediaType.parseMediaType(ActuatorMediaType.V2_JSON))
.syncBody(Collections.singletonMap("configuredLevel", null)).exchange()
.expectStatus().isNoContent();
@ -139,7 +139,7 @@ public class LoggersEndpointWebIntegrationTests {
@Test
public void setLoggerWithNoLogLevel() throws Exception {
client.post().uri("/application/loggers/ROOT")
client.post().uri("/actuator/loggers/ROOT")
.contentType(MediaType.parseMediaType(ActuatorMediaType.V2_JSON))
.syncBody(Collections.emptyMap()).exchange().expectStatus().isNoContent();
verify(this.loggingSystem).setLogLevel("ROOT", null);
@ -150,7 +150,7 @@ public class LoggersEndpointWebIntegrationTests {
throws Exception {
given(this.loggingSystem.getLoggerConfiguration("com.png"))
.willReturn(new LoggerConfiguration("com.png", null, LogLevel.DEBUG));
client.get().uri("/application/loggers/com.png").exchange().expectStatus().isOk()
client.get().uri("/actuator/loggers/com.png").exchange().expectStatus().isOk()
.expectBody().jsonPath("$.length()").isEqualTo(2)
.jsonPath("configuredLevel").isEqualTo(null).jsonPath("effectiveLevel")
.isEqualTo("DEBUG");

@ -61,13 +61,13 @@ public class HeapDumpWebEndpointWebIntegrationTests {
public void invokeWhenNotAvailableShouldReturnServiceUnavailableStatus()
throws Exception {
this.endpoint.setAvailable(false);
client.get().uri("/application/heapdump").exchange().expectStatus()
client.get().uri("/actuator/heapdump").exchange().expectStatus()
.isEqualTo(HttpStatus.SERVICE_UNAVAILABLE);
}
@Test
public void getRequestShouldReturnHeapDumpInResponseBody() throws Exception {
client.get().uri("/application/heapdump").exchange().expectStatus().isOk()
client.get().uri("/actuator/heapdump").exchange().expectStatus().isOk()
.expectHeader().contentType(MediaType.APPLICATION_OCTET_STREAM)
.expectBody(String.class).isEqualTo("HEAPDUMP");
assertHeapDumpFileIsDeleted();

@ -55,7 +55,7 @@ public class MetricsEndpointWebIntegrationTests {
@Test
@SuppressWarnings("unchecked")
public void listNames() throws IOException {
String responseBody = client.get().uri("/application/metrics").exchange()
String responseBody = client.get().uri("/actuator/metrics").exchange()
.expectStatus().isOk().expectBody(String.class).returnResult()
.getResponseBody();
Map<String, List<String>> names = this.mapper.readValue(responseBody, Map.class);
@ -65,7 +65,7 @@ public class MetricsEndpointWebIntegrationTests {
@Test
public void selectByName() throws IOException {
MockClock.clock(registry).add(SimpleConfig.DEFAULT_STEP);
client.get().uri("/application/metrics/jvm.memory.used").exchange().expectStatus()
client.get().uri("/actuator/metrics/jvm.memory.used").exchange().expectStatus()
.isOk().expectBody().jsonPath("$.name").isEqualTo("jvm.memory.used");
}
@ -73,7 +73,7 @@ public class MetricsEndpointWebIntegrationTests {
public void selectByTag() {
MockClock.clock(registry).add(SimpleConfig.DEFAULT_STEP);
client.get()
.uri("/application/metrics/jvm.memory.used?tag=id:Compressed%20Class%20Space")
.uri("/actuator/metrics/jvm.memory.used?tag=id:Compressed%20Class%20Space")
.exchange().expectStatus().isOk().expectBody().jsonPath("$.name")
.isEqualTo("jvm.memory.used");
}

@ -42,7 +42,7 @@ public class PrometheusScrapeEndpointIntegrationTests {
@Test
public void scrapeHasContentTypeText004() {
client.get().uri("/application/prometheus").exchange().expectStatus().isOk()
client.get().uri("/actuator/prometheus").exchange().expectStatus().isOk()
.expectHeader()
.contentType(MediaType.parseMediaType(TextFormat.CONTENT_TYPE_004));
}

@ -52,7 +52,7 @@ public class SessionsEndpointWebIntegrationTests {
@Test
public void sessionsForUsernameWithoutUsernameParam() throws Exception {
client.get().uri((builder) -> builder.path("/application/sessions").build())
client.get().uri((builder) -> builder.path("/actuator/sessions").build())
.exchange().expectStatus().isBadRequest();
}
@ -62,7 +62,7 @@ public class SessionsEndpointWebIntegrationTests {
FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, "user"))
.willReturn(Collections.emptyMap());
client.get()
.uri((builder) -> builder.path("/application/sessions")
.uri((builder) -> builder.path("/actuator/sessions")
.queryParam("username", "user").build())
.exchange().expectStatus().isOk().expectBody().jsonPath("sessions")
.isEmpty();
@ -74,7 +74,7 @@ public class SessionsEndpointWebIntegrationTests {
FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME, "user"))
.willReturn(Collections.singletonMap(session.getId(), session));
client.get()
.uri((builder) -> builder.path("/application/sessions")
.uri((builder) -> builder.path("/actuator/sessions")
.queryParam("username", "user").build())
.exchange().expectStatus().isOk().expectBody().jsonPath("sessions.[*].id")
.isEqualTo(new JSONArray().appendElement(session.getId()));

@ -1125,7 +1125,7 @@ content into your application. Rather, pick only the properties that you need.
management.endpoints.web.enabled=true # Whether web endpoints are enabled
management.endpoints.web.expose=info,status # Endpoint IDs that should be exposed or '*' for all.
management.endpoints.web.exclude= # Endpoint IDs that should be excluded.
management.endpoints.web.base-path=/application # Base path for Web endpoints. Relative to server.context-path or management.server.context-path if management.server.port is configured.
management.endpoints.web.base-path=/actuator # Base path for Web endpoints. Relative to server.context-path or management.server.context-path if management.server.port is configured.
management.endpoints.web.path-mapping= # Mapping between endpoint IDs and the path that should expose them.
# ENDPOINTS CORS CONFIGURATION ({sc-spring-boot-actuator-autoconfigure}/endpoint/web/servlet/CorsEndpointProperties.{sc-ext}[CorsEndpointProperties])

@ -65,7 +65,7 @@ reading the code, remember the following rules of thumb:
`+@Conditional*+` annotations to find out what features they enable and when. Add
`--debug` to the command line or a System property `-Ddebug` to get a log on the
console of all the auto-configuration decisions that were made in your app. In a running
Actuator app, look at the `conditions` endpoint (`/application/conditions` or the JMX
Actuator app, look at the `conditions` endpoint (`/actuator/conditions` or the JMX
equivalent) for the same information.
* Look for classes that are `@ConfigurationProperties` (such as
{sc-spring-boot-autoconfigure}/web/ServerProperties.{sc-ext}[`ServerProperties`])

@ -55,8 +55,8 @@ includes a number of built-in endpoints and lets you add your own. For example,
The way that endpoints are exposed depends on the type of technology that you choose.
Most applications choose HTTP monitoring, where the ID of the endpoint along with a
prefix of `/application` is mapped to a URL. For example, by default, the `health`
endpoint is mapped to `/application/health`.
prefix of `/actuator` is mapped to a URL. For example, by default, the `health`
endpoint is mapped to `/actuator/health`.
The following technology-agnostic endpoints are available:
@ -257,10 +257,10 @@ and `exclude` properties (see <<production-ready-endpoints-exposing-endpoints>>)
[[production-ready-endpoint-hypermedia]]
=== Hypermedia for Actuator Web Endpoints
A "`discovery page`" is added with links to all the endpoints. The "`discovery page`" is
available on `/application` by default.
available on `/actuator` by default.
When a custom management context path is configured, the "`discovery page`" automatically
moves from `/application` to the root of the management context. For example, if the
moves from `/actuator` to the root of the management context. For example, if the
management context path is `/management`, then the discovery page is available from
`/management`. When the management context path is set to `/`, the discovery page is
disabled to prevent the possibility of a clash with other mappings.
@ -269,13 +269,13 @@ disabled to prevent the possibility of a clash with other mappings.
[[production-ready-endpoint-custom-mapping]]
=== Actuator Web Endpoint Paths
By default, endpoints are exposed over HTTP under the `/application` path using ID of the
endpoint. For example, the `beans` endpoint is exposed under `/application/beans`. If you
By default, endpoints are exposed over HTTP under the `/actuator` path using ID of the
endpoint. For example, the `beans` endpoint is exposed under `/actuator/beans`. If you
want to map endpoints to a different path you can use the
`management.endpoints.web.path-mapping` property. You can also use
`management.endpoints.web.base-path` if you want change the base path.
Here's an example that remaps `/application/health` to `/healthcheck`:
Here's an example that remaps `/actuator/health` to `/healthcheck`:
.application.properties
[source,properties,indent=0]
@ -642,15 +642,15 @@ additional entry:
== Monitoring and Management over HTTP
If you are developing a Spring MVC application, Spring Boot Actuator auto-configures all
enabled endpoints to be exposed over HTTP. The default convention is to use the `id` of
the endpoint with a prefix of `/application` as the URL path. For example, `health` is
exposed as `/application/health`.
the endpoint with a prefix of `/actuator` as the URL path. For example, `health` is
exposed as `/actuator/health`.
[[production-ready-customizing-management-server-context-path]]
=== Customizing the Management Endpoint Paths
Sometimes, it is useful to customize the prefix for the management endpoints. For
example, your application might already use `/application` for another purpose. You can
example, your application might already use `/actuator` for another purpose. You can
use the `management.endpoints.web.base-path` property to change the prefix for your
management endpoint, as shown in the following example:
@ -660,7 +660,7 @@ management endpoint, as shown in the following example:
----
The preceding `application.properties` example changes the endpoint from
`/application/{id}` to `/manage/{id}` (e.g. `/manage/info`).
`/actuator/{id}` to `/manage/{id}` (e.g. `/manage/info`).
NOTE: Unless the management port has been configured to
<<production-ready-customizing-management-server-port,expose endpoints using a different
@ -882,7 +882,7 @@ Maven, you would add the following dependency:
</dependency>
----
Jolokia can then be accessed by using `/application/jolokia` on your management HTTP
Jolokia can then be accessed by using `/actuator/jolokia` on your management HTTP
server.

@ -1247,7 +1247,7 @@ validation sample] that shows how to set things up.
TIP: The `spring-boot-actuator` module includes an endpoint that exposes all
`@ConfigurationProperties` beans. Point your web browser to
`/application/configprops` or use the equivalent JMX endpoint. See the
`/actuator/configprops` or use the equivalent JMX endpoint. See the
"<<production-ready-features.adoc#production-ready-endpoints, Production ready features>>"
section for details.

@ -65,15 +65,14 @@ public class CorsSampleActuatorApplicationTests {
@Test
public void endpointShouldReturnUnauthorized() throws Exception {
ResponseEntity<?> entity = this.testRestTemplate.getForEntity("/application/env",
ResponseEntity<?> entity = this.testRestTemplate.getForEntity("/actuator/env",
Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
}
@Test
public void preflightRequestToEndpointShouldReturnOk() throws Exception {
RequestEntity<?> healthRequest = RequestEntity
.options(new URI("/application/env"))
RequestEntity<?> healthRequest = RequestEntity.options(new URI("/actuator/env"))
.header("Origin", "http://localhost:8080")
.header("Access-Control-Request-Method", "GET").build();
ResponseEntity<?> exchange = this.testRestTemplate.exchange(healthRequest,
@ -84,7 +83,7 @@ public class CorsSampleActuatorApplicationTests {
@Test
public void preflightRequestWhenCorsConfigInvalidShouldReturnForbidden()
throws Exception {
RequestEntity<?> entity = RequestEntity.options(new URI("/application/env"))
RequestEntity<?> entity = RequestEntity.options(new URI("/actuator/env"))
.header("Origin", "http://localhost:9095")
.header("Access-Control-Request-Method", "GET").build();
ResponseEntity<byte[]> exchange = this.testRestTemplate.exchange(entity,

@ -58,16 +58,16 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
@Test
public void testSecureActuator() throws Exception {
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(
"http://localhost:" + this.managementPort + "/management/application/env",
"http://localhost:" + this.managementPort + "/management/actuator/env",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
}
@Test
public void testInsecureActuator() throws Exception {
ResponseEntity<String> entity = new TestRestTemplate()
.getForEntity("http://localhost:" + this.managementPort
+ "/management/application/health", String.class);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(
"http://localhost:" + this.managementPort + "/management/actuator/health",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).contains("\"status\":\"UP\"");
}
@ -76,7 +76,7 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
public void testMissing() throws Exception {
ResponseEntity<String> entity = new TestRestTemplate("admin", "admin")
.getForEntity("http://localhost:" + this.managementPort
+ "/management/application/missing", String.class);
+ "/management/actuator/missing", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
assertThat(entity.getBody()).contains("\"status\":404");
}

@ -72,8 +72,8 @@ public class SampleActuatorCustomSecurityApplicationTests {
@Test
public void insecureActuator() throws Exception {
ResponseEntity<String> entity = this.restTemplate
.getForEntity("/application/health", String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/actuator/health",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).contains("\"status\":\"UP\"");
}
@ -81,7 +81,7 @@ public class SampleActuatorCustomSecurityApplicationTests {
@Test
public void secureActuator() throws Exception {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = this.restTemplate.getForEntity("/application/env",
ResponseEntity<Map> entity = this.restTemplate.getForEntity("/actuator/env",
Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
}

@ -66,7 +66,7 @@ public class SampleActuatorLog4J2ApplicationTests {
@Test
public void validateLoggersEndpoint() throws Exception {
this.mvc.perform(
get("/application/loggers/org.apache.coyote.http11.Http11NioProtocol")
get("/actuator/loggers/org.apache.coyote.http11.Http11NioProtocol")
.header("Authorization", "Basic " + getBasicAuth()))
.andExpect(status().isOk())
.andExpect(content().string(equalTo("{\"configuredLevel\":\"WARN\","

@ -59,7 +59,7 @@ public class SampleActuatorUiApplicationPortTests {
public void testMetrics() throws Exception {
@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);
}
@ -68,7 +68,7 @@ public class SampleActuatorUiApplicationPortTests {
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\"");

@ -70,8 +70,8 @@ public class SampleActuatorUiApplicationTests {
@Test
public void testMetrics() throws Exception {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = this.restTemplate
.getForEntity("/application/metrics", Map.class);
ResponseEntity<Map> entity = this.restTemplate.getForEntity("/actuator/metrics",
Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
}

@ -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();

@ -2,7 +2,7 @@
This sample demonstrates the flyway auto-configuration support.
You can look at `http://localhost:8080/application/flyway` to review the list of scripts.
You can look at `http://localhost:8080/actuator/flyway` to review the list of scripts.
This sample also enables the H2 console (at `http://localhost:8080/h2-console`)
so that you can review the state of the database (the default jdbc url is

@ -60,8 +60,8 @@ public class SampleJerseyApplicationTests {
@Test
public void actuatorStatus() {
ResponseEntity<String> entity = this.restTemplate
.getForEntity("/application/health", String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/actuator/health",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
}

@ -2,7 +2,7 @@
This sample demonstrates the liquibase auto-configuration support.
You can look at `http://localhost:8080/application/liquibase` to review the list of
You can look at `http://localhost:8080/actuator/liquibase` to review the list of
scripts.
This sample also enables the H2 console (at `http://localhost:8080/h2-console`)

@ -48,7 +48,7 @@ public class SampleSecureWebFluxApplicationTests {
@Test
public void actuatorsSecureByDefault() {
this.webClient.get().uri("/application/health").accept(MediaType.APPLICATION_JSON)
this.webClient.get().uri("/actuator/health").accept(MediaType.APPLICATION_JSON)
.exchange().expectStatus().isUnauthorized();
}
@ -61,7 +61,7 @@ public class SampleSecureWebFluxApplicationTests {
@Test
public void actuatorsAccessibleOnLogin() {
this.webClient.get().uri("/application/health").accept(MediaType.APPLICATION_JSON)
this.webClient.get().uri("/actuator/health").accept(MediaType.APPLICATION_JSON)
.header("Authorization", "basic " + getBasicAuth()).exchange()
.expectBody(String.class).isEqualTo("{\"status\":\"UP\"}");
}

@ -105,7 +105,7 @@ public class SampleMethodSecurityApplicationTests {
public void testManagementProtected() throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
ResponseEntity<String> entity = this.restTemplate.exchange("/application/beans",
ResponseEntity<String> entity = this.restTemplate.exchange("/actuator/beans",
HttpMethod.GET, new HttpEntity<Void>(headers), String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
}
@ -117,7 +117,7 @@ public class SampleMethodSecurityApplicationTests {
this.restTemplate.getRestTemplate().getInterceptors().add(basicAuthInterceptor);
try {
ResponseEntity<String> entity = this.restTemplate
.getForEntity("/application/beans", String.class);
.getForEntity("/actuator/beans", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
finally {

@ -55,7 +55,7 @@ public class SampleWebFluxApplicationTests {
@Test
public void testActuatorStatus() {
this.webClient.get().uri("/application/health").accept(MediaType.APPLICATION_JSON)
this.webClient.get().uri("/actuator/health").accept(MediaType.APPLICATION_JSON)
.exchange().expectStatus().isOk().expectBody()
.json("{\"status\":\"UP\"}");
}

Loading…
Cancel
Save