Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
8bfd42e3
Commit
8bfd42e3
authored
Mar 27, 2017
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add v2 content type to actuator endpoints
Closes gh-7968
parent
28a4d5e0
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
44 additions
and
32 deletions
+44
-32
EndpointDocumentation.java
...mework/boot/actuate/hypermedia/EndpointDocumentation.java
+5
-5
HealthEndpointDocumentation.java
.../boot/actuate/hypermedia/HealthEndpointDocumentation.java
+1
-1
HypermediaEndpointDocumentation.java
...t/actuate/hypermedia/HypermediaEndpointDocumentation.java
+3
-3
EndpointWebMvcHypermediaManagementContextConfiguration.java
...dpointWebMvcHypermediaManagementContextConfiguration.java
+1
-1
ActuatorGetMapping.java
...amework/boot/actuate/endpoint/mvc/ActuatorGetMapping.java
+1
-1
ActuatorMediaTypes.java
...amework/boot/actuate/endpoint/mvc/ActuatorMediaTypes.java
+12
-0
ActuatorPostMapping.java
...mework/boot/actuate/endpoint/mvc/ActuatorPostMapping.java
+2
-2
ShutdownMvcEndpoint.java
...mework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java
+1
-1
AuditEventsMvcEndpointTests.java
...oot/actuate/endpoint/mvc/AuditEventsMvcEndpointTests.java
+2
-2
EnvironmentMvcEndpointTests.java
...oot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java
+4
-4
InfoMvcEndpointTests.java
...ework/boot/actuate/endpoint/mvc/InfoMvcEndpointTests.java
+2
-2
LoggersMvcEndpointTests.java
...rk/boot/actuate/endpoint/mvc/LoggersMvcEndpointTests.java
+4
-4
MetricsMvcEndpointTests.java
...rk/boot/actuate/endpoint/mvc/MetricsMvcEndpointTests.java
+4
-4
ShutdownMvcEndpointTests.java
...k/boot/actuate/endpoint/mvc/ShutdownMvcEndpointTests.java
+2
-2
No files found.
spring-boot-actuator-docs/src/restdoc/java/org/springframework/boot/actuate/hypermedia/EndpointDocumentation.java
View file @
8bfd42e3
...
@@ -124,7 +124,7 @@ public class EndpointDocumentation {
...
@@ -124,7 +124,7 @@ public class EndpointDocumentation {
public
void
setLogger
()
throws
Exception
{
public
void
setLogger
()
throws
Exception
{
this
.
mockMvc
this
.
mockMvc
.
perform
(
post
(
"/loggers/org.springframework.boot"
)
.
perform
(
post
(
"/loggers/org.springframework.boot"
)
.
contentType
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
)
.
contentType
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
)
.
content
(
"{\"configuredLevel\": \"DEBUG\"}"
))
.
content
(
"{\"configuredLevel\": \"DEBUG\"}"
))
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"set-logger"
));
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"set-logger"
));
}
}
...
@@ -133,7 +133,7 @@ public class EndpointDocumentation {
...
@@ -133,7 +133,7 @@ public class EndpointDocumentation {
public
void
auditEvents
()
throws
Exception
{
public
void
auditEvents
()
throws
Exception
{
this
.
mockMvc
this
.
mockMvc
.
perform
(
get
(
"/auditevents"
).
param
(
"after"
,
"2016-11-01T10:00:00+0000"
)
.
perform
(
get
(
"/auditevents"
).
param
(
"after"
,
"2016-11-01T10:00:00+0000"
)
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
))
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
))
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"auditevents"
));
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"auditevents"
));
}
}
...
@@ -142,7 +142,7 @@ public class EndpointDocumentation {
...
@@ -142,7 +142,7 @@ public class EndpointDocumentation {
this
.
mockMvc
this
.
mockMvc
.
perform
(
get
(
"/auditevents"
).
param
(
"principal"
,
"admin"
)
.
perform
(
get
(
"/auditevents"
).
param
(
"principal"
,
"admin"
)
.
param
(
"after"
,
"2016-11-01T10:00:00+0000"
)
.
param
(
"after"
,
"2016-11-01T10:00:00+0000"
)
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
))
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
))
.
andExpect
(
status
().
isOk
())
.
andExpect
(
status
().
isOk
())
.
andDo
(
document
(
"auditevents/filter-by-principal"
));
.
andDo
(
document
(
"auditevents/filter-by-principal"
));
}
}
...
@@ -153,7 +153,7 @@ public class EndpointDocumentation {
...
@@ -153,7 +153,7 @@ public class EndpointDocumentation {
.
perform
(
get
(
"/auditevents"
).
param
(
"principal"
,
"admin"
)
.
perform
(
get
(
"/auditevents"
).
param
(
"principal"
,
"admin"
)
.
param
(
"after"
,
"2016-11-01T10:00:00+0000"
)
.
param
(
"after"
,
"2016-11-01T10:00:00+0000"
)
.
param
(
"type"
,
"AUTHENTICATION_SUCCESS"
)
.
param
(
"type"
,
"AUTHENTICATION_SUCCESS"
)
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
))
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
))
.
andExpect
(
status
().
isOk
())
.
andExpect
(
status
().
isOk
())
.
andDo
(
document
(
"auditevents/filter-by-principal-and-type"
));
.
andDo
(
document
(
"auditevents/filter-by-principal-and-type"
));
}
}
...
@@ -172,7 +172,7 @@ public class EndpointDocumentation {
...
@@ -172,7 +172,7 @@ public class EndpointDocumentation {
output
=
output
.
length
()
>
0
?
output
:
"./"
;
output
=
output
.
length
()
>
0
?
output
:
"./"
;
this
.
mockMvc
this
.
mockMvc
.
perform
(
get
(
endpointPath
)
.
perform
(
get
(
endpointPath
)
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
))
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
))
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
output
))
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
output
))
.
andDo
(
new
ResultHandler
()
{
.
andDo
(
new
ResultHandler
()
{
...
...
spring-boot-actuator-docs/src/restdoc/java/org/springframework/boot/actuate/hypermedia/HealthEndpointDocumentation.java
View file @
8bfd42e3
...
@@ -52,7 +52,7 @@ public class HealthEndpointDocumentation {
...
@@ -52,7 +52,7 @@ public class HealthEndpointDocumentation {
public
void
health
()
throws
Exception
{
public
void
health
()
throws
Exception
{
this
.
mockMvc
this
.
mockMvc
.
perform
(
get
(
"/health"
)
.
perform
(
get
(
"/health"
)
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
))
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
))
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"health/insensitive"
));
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"health/insensitive"
));
}
}
...
...
spring-boot-actuator-docs/src/restdoc/java/org/springframework/boot/actuate/hypermedia/HypermediaEndpointDocumentation.java
View file @
8bfd42e3
...
@@ -53,7 +53,7 @@ public class HypermediaEndpointDocumentation {
...
@@ -53,7 +53,7 @@ public class HypermediaEndpointDocumentation {
public
void
beans
()
throws
Exception
{
public
void
beans
()
throws
Exception
{
this
.
mockMvc
this
.
mockMvc
.
perform
(
get
(
"/beans"
)
.
perform
(
get
(
"/beans"
)
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
))
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
))
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"beans/hypermedia"
));
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"beans/hypermedia"
));
}
}
...
@@ -61,7 +61,7 @@ public class HypermediaEndpointDocumentation {
...
@@ -61,7 +61,7 @@ public class HypermediaEndpointDocumentation {
public
void
metrics
()
throws
Exception
{
public
void
metrics
()
throws
Exception
{
this
.
mockMvc
this
.
mockMvc
.
perform
(
get
(
"/metrics"
)
.
perform
(
get
(
"/metrics"
)
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
))
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
))
.
andExpect
(
status
().
isOk
())
.
andExpect
(
status
().
isOk
())
.
andExpect
(
jsonPath
(
"$._links.self.href"
)
.
andExpect
(
jsonPath
(
"$._links.self.href"
)
.
value
(
"http://localhost:8080/metrics"
))
.
value
(
"http://localhost:8080/metrics"
))
...
@@ -72,7 +72,7 @@ public class HypermediaEndpointDocumentation {
...
@@ -72,7 +72,7 @@ public class HypermediaEndpointDocumentation {
public
void
home
()
throws
Exception
{
public
void
home
()
throws
Exception
{
this
.
mockMvc
this
.
mockMvc
.
perform
(
get
(
"/actuator"
)
.
perform
(
get
(
"/actuator"
)
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
))
.
accept
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
))
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"admin"
));
.
andExpect
(
status
().
isOk
()).
andDo
(
document
(
"admin"
));
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java
View file @
8bfd42e3
...
@@ -250,7 +250,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
...
@@ -250,7 +250,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
if
(
messageConverter
instanceof
TypeConstrainedMappingJackson2HttpMessageConverter
)
{
if
(
messageConverter
instanceof
TypeConstrainedMappingJackson2HttpMessageConverter
)
{
List
<
MediaType
>
supportedMediaTypes
=
new
ArrayList
<>(
List
<
MediaType
>
supportedMediaTypes
=
new
ArrayList
<>(
messageConverter
.
getSupportedMediaTypes
());
messageConverter
.
getSupportedMediaTypes
());
supportedMediaTypes
.
add
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
);
supportedMediaTypes
.
add
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
);
((
AbstractHttpMessageConverter
<?>)
messageConverter
)
((
AbstractHttpMessageConverter
<?>)
messageConverter
)
.
setSupportedMediaTypes
(
supportedMediaTypes
);
.
setSupportedMediaTypes
(
supportedMediaTypes
);
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ActuatorGetMapping.java
View file @
8bfd42e3
...
@@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
...
@@ -38,7 +38,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
@Documented
@RequestMapping
(
method
=
RequestMethod
.
GET
,
produces
=
{
@RequestMapping
(
method
=
RequestMethod
.
GET
,
produces
=
{
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON_VALUE
,
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON_VALUE
,
MediaType
.
APPLICATION_JSON_VALUE
})
MediaType
.
APPLICATION_JSON_VALUE
})
@interface
ActuatorGetMapping
{
@interface
ActuatorGetMapping
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ActuatorMediaTypes.java
View file @
8bfd42e3
...
@@ -22,6 +22,7 @@ import org.springframework.http.MediaType;
...
@@ -22,6 +22,7 @@ import org.springframework.http.MediaType;
* {@link MediaType MediaTypes} that can be consumed and produced by Actuator endpoints.
* {@link MediaType MediaTypes} that can be consumed and produced by Actuator endpoints.
*
*
* @author Andy Wilkinson
* @author Andy Wilkinson
* @author Madhura Bhave
* @since 1.5.0
* @since 1.5.0
*/
*/
public
final
class
ActuatorMediaTypes
{
public
final
class
ActuatorMediaTypes
{
...
@@ -31,12 +32,23 @@ public final class ActuatorMediaTypes {
...
@@ -31,12 +32,23 @@ public final class ActuatorMediaTypes {
*/
*/
public
static
final
String
APPLICATION_ACTUATOR_V1_JSON_VALUE
=
"application/vnd.spring-boot.actuator.v1+json"
;
public
static
final
String
APPLICATION_ACTUATOR_V1_JSON_VALUE
=
"application/vnd.spring-boot.actuator.v1+json"
;
/**
* {@link String} equivalent of {@link #APPLICATION_ACTUATOR_V2_JSON}.
*/
public
static
final
String
APPLICATION_ACTUATOR_V2_JSON_VALUE
=
"application/vnd.spring-boot.actuator.v2+json"
;
/**
/**
* The {@code application/vnd.spring-boot.actuator.v1+json} media type.
* The {@code application/vnd.spring-boot.actuator.v1+json} media type.
*/
*/
public
static
final
MediaType
APPLICATION_ACTUATOR_V1_JSON
=
MediaType
public
static
final
MediaType
APPLICATION_ACTUATOR_V1_JSON
=
MediaType
.
valueOf
(
APPLICATION_ACTUATOR_V1_JSON_VALUE
);
.
valueOf
(
APPLICATION_ACTUATOR_V1_JSON_VALUE
);
/**
* The {@code application/vnd.spring-boot.actuator.v2+json} media type.
*/
public
static
final
MediaType
APPLICATION_ACTUATOR_V2_JSON
=
MediaType
.
valueOf
(
APPLICATION_ACTUATOR_V2_JSON_VALUE
);
private
ActuatorMediaTypes
()
{
private
ActuatorMediaTypes
()
{
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ActuatorPostMapping.java
View file @
8bfd42e3
...
@@ -40,9 +40,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
...
@@ -40,9 +40,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
@Documented
@RequestMapping
(
method
=
RequestMethod
.
POST
,
consumes
=
{
@RequestMapping
(
method
=
RequestMethod
.
POST
,
consumes
=
{
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON_VALUE
,
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON_VALUE
,
MediaType
.
APPLICATION_JSON_VALUE
},
produces
=
{
MediaType
.
APPLICATION_JSON_VALUE
},
produces
=
{
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON_VALUE
,
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON_VALUE
,
MediaType
.
APPLICATION_JSON_VALUE
})
MediaType
.
APPLICATION_JSON_VALUE
})
@interface
ActuatorPostMapping
{
@interface
ActuatorPostMapping
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpoint.java
View file @
8bfd42e3
...
@@ -38,7 +38,7 @@ public class ShutdownMvcEndpoint extends EndpointMvcAdapter {
...
@@ -38,7 +38,7 @@ public class ShutdownMvcEndpoint extends EndpointMvcAdapter {
super
(
delegate
);
super
(
delegate
);
}
}
@PostMapping
(
produces
=
{
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON_VALUE
,
@PostMapping
(
produces
=
{
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON_VALUE
,
MediaType
.
APPLICATION_JSON_VALUE
})
MediaType
.
APPLICATION_JSON_VALUE
})
@ResponseBody
@ResponseBody
@Override
@Override
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/AuditEventsMvcEndpointTests.java
View file @
8bfd42e3
...
@@ -73,10 +73,10 @@ public class AuditEventsMvcEndpointTests {
...
@@ -73,10 +73,10 @@ public class AuditEventsMvcEndpointTests {
}
}
@Test
@Test
public
void
contentTypeDefaultsToActuatorV
1
Json
()
throws
Exception
{
public
void
contentTypeDefaultsToActuatorV
2
Json
()
throws
Exception
{
this
.
mvc
.
perform
(
get
(
"/auditevents"
)).
andExpect
(
status
().
isOk
())
this
.
mvc
.
perform
(
get
(
"/auditevents"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"Content-Type"
,
.
andExpect
(
header
().
string
(
"Content-Type"
,
"application/vnd.spring-boot.actuator.v
1
+json;charset=UTF-8"
));
"application/vnd.spring-boot.actuator.v
2
+json;charset=UTF-8"
));
}
}
@Test
@Test
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/EnvironmentMvcEndpointTests.java
View file @
8bfd42e3
...
@@ -79,10 +79,10 @@ public class EnvironmentMvcEndpointTests {
...
@@ -79,10 +79,10 @@ public class EnvironmentMvcEndpointTests {
}
}
@Test
@Test
public
void
homeContentTypeDefaultsToActuatorV
1
Json
()
throws
Exception
{
public
void
homeContentTypeDefaultsToActuatorV
2
Json
()
throws
Exception
{
this
.
mvc
.
perform
(
get
(
"/env"
)).
andExpect
(
status
().
isOk
())
this
.
mvc
.
perform
(
get
(
"/env"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"Content-Type"
,
.
andExpect
(
header
().
string
(
"Content-Type"
,
"application/vnd.spring-boot.actuator.v
1
+json;charset=UTF-8"
));
"application/vnd.spring-boot.actuator.v
2
+json;charset=UTF-8"
));
}
}
@Test
@Test
...
@@ -94,10 +94,10 @@ public class EnvironmentMvcEndpointTests {
...
@@ -94,10 +94,10 @@ public class EnvironmentMvcEndpointTests {
}
}
@Test
@Test
public
void
subContentTypeDefaultsToActuatorV
1
Json
()
throws
Exception
{
public
void
subContentTypeDefaultsToActuatorV
2
Json
()
throws
Exception
{
this
.
mvc
.
perform
(
get
(
"/env/foo"
)).
andExpect
(
status
().
isOk
())
this
.
mvc
.
perform
(
get
(
"/env/foo"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"Content-Type"
,
.
andExpect
(
header
().
string
(
"Content-Type"
,
"application/vnd.spring-boot.actuator.v
1
+json;charset=UTF-8"
));
"application/vnd.spring-boot.actuator.v
2
+json;charset=UTF-8"
));
}
}
@Test
@Test
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/InfoMvcEndpointTests.java
View file @
8bfd42e3
...
@@ -83,10 +83,10 @@ public class InfoMvcEndpointTests {
...
@@ -83,10 +83,10 @@ public class InfoMvcEndpointTests {
}
}
@Test
@Test
public
void
contentTypeDefaultsToActuatorV
1
Json
()
throws
Exception
{
public
void
contentTypeDefaultsToActuatorV
2
Json
()
throws
Exception
{
this
.
mvc
.
perform
(
get
(
"/info"
)).
andExpect
(
status
().
isOk
())
this
.
mvc
.
perform
(
get
(
"/info"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"Content-Type"
,
.
andExpect
(
header
().
string
(
"Content-Type"
,
"application/vnd.spring-boot.actuator.v
1
+json;charset=UTF-8"
));
"application/vnd.spring-boot.actuator.v
2
+json;charset=UTF-8"
));
}
}
@Test
@Test
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/LoggersMvcEndpointTests.java
View file @
8bfd42e3
...
@@ -130,10 +130,10 @@ public class LoggersMvcEndpointTests {
...
@@ -130,10 +130,10 @@ public class LoggersMvcEndpointTests {
}
}
@Test
@Test
public
void
contentTypeForGetDefaultsToActuatorV
1
Json
()
throws
Exception
{
public
void
contentTypeForGetDefaultsToActuatorV
2
Json
()
throws
Exception
{
this
.
mvc
.
perform
(
get
(
"/loggers"
)).
andExpect
(
status
().
isOk
())
this
.
mvc
.
perform
(
get
(
"/loggers"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"Content-Type"
,
.
andExpect
(
header
().
string
(
"Content-Type"
,
"application/vnd.spring-boot.actuator.v
1
+json;charset=UTF-8"
));
"application/vnd.spring-boot.actuator.v
2
+json;charset=UTF-8"
));
}
}
@Test
@Test
...
@@ -152,9 +152,9 @@ public class LoggersMvcEndpointTests {
...
@@ -152,9 +152,9 @@ public class LoggersMvcEndpointTests {
}
}
@Test
@Test
public
void
setLoggerUsingActuatorV
1
JsonShouldSetLogLevel
()
throws
Exception
{
public
void
setLoggerUsingActuatorV
2
JsonShouldSetLogLevel
()
throws
Exception
{
this
.
mvc
.
perform
(
post
(
"/loggers/ROOT"
)
this
.
mvc
.
perform
(
post
(
"/loggers/ROOT"
)
.
contentType
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
1
_JSON
)
.
contentType
(
ActuatorMediaTypes
.
APPLICATION_ACTUATOR_V
2
_JSON
)
.
content
(
"{\"configuredLevel\":\"debug\"}"
)).
andExpect
(
status
().
isOk
());
.
content
(
"{\"configuredLevel\":\"debug\"}"
)).
andExpect
(
status
().
isOk
());
verify
(
this
.
loggingSystem
).
setLogLevel
(
"ROOT"
,
LogLevel
.
DEBUG
);
verify
(
this
.
loggingSystem
).
setLogLevel
(
"ROOT"
,
LogLevel
.
DEBUG
);
}
}
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/MetricsMvcEndpointTests.java
View file @
8bfd42e3
...
@@ -83,10 +83,10 @@ public class MetricsMvcEndpointTests {
...
@@ -83,10 +83,10 @@ public class MetricsMvcEndpointTests {
}
}
@Test
@Test
public
void
homeContentTypeDefaultsToActuatorV
1
Json
()
throws
Exception
{
public
void
homeContentTypeDefaultsToActuatorV
2
Json
()
throws
Exception
{
this
.
mvc
.
perform
(
get
(
"/metrics"
)).
andExpect
(
status
().
isOk
())
this
.
mvc
.
perform
(
get
(
"/metrics"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"Content-Type"
,
.
andExpect
(
header
().
string
(
"Content-Type"
,
"application/vnd.spring-boot.actuator.v
1
+json;charset=UTF-8"
));
"application/vnd.spring-boot.actuator.v
2
+json;charset=UTF-8"
));
}
}
@Test
@Test
...
@@ -98,10 +98,10 @@ public class MetricsMvcEndpointTests {
...
@@ -98,10 +98,10 @@ public class MetricsMvcEndpointTests {
}
}
@Test
@Test
public
void
specificMetricContentTypeDefaultsToActuatorV
1
Json
()
throws
Exception
{
public
void
specificMetricContentTypeDefaultsToActuatorV
2
Json
()
throws
Exception
{
this
.
mvc
.
perform
(
get
(
"/metrics/foo"
)).
andExpect
(
status
().
isOk
())
this
.
mvc
.
perform
(
get
(
"/metrics/foo"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"Content-Type"
,
.
andExpect
(
header
().
string
(
"Content-Type"
,
"application/vnd.spring-boot.actuator.v
1
+json;charset=UTF-8"
));
"application/vnd.spring-boot.actuator.v
2
+json;charset=UTF-8"
));
}
}
@Test
@Test
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/mvc/ShutdownMvcEndpointTests.java
View file @
8bfd42e3
...
@@ -74,10 +74,10 @@ public class ShutdownMvcEndpointTests {
...
@@ -74,10 +74,10 @@ public class ShutdownMvcEndpointTests {
}
}
@Test
@Test
public
void
contentTypeDefaultsToActuatorV
1
Json
()
throws
Exception
{
public
void
contentTypeDefaultsToActuatorV
2
Json
()
throws
Exception
{
this
.
mvc
.
perform
(
post
(
"/shutdown"
)).
andExpect
(
status
().
isOk
())
this
.
mvc
.
perform
(
post
(
"/shutdown"
)).
andExpect
(
status
().
isOk
())
.
andExpect
(
header
().
string
(
"Content-Type"
,
.
andExpect
(
header
().
string
(
"Content-Type"
,
"application/vnd.spring-boot.actuator.v
1
+json;charset=UTF-8"
));
"application/vnd.spring-boot.actuator.v
2
+json;charset=UTF-8"
));
assertThat
(
this
.
context
.
getBean
(
CountDownLatch
.
class
).
await
(
30
,
TimeUnit
.
SECONDS
))
assertThat
(
this
.
context
.
getBean
(
CountDownLatch
.
class
).
await
(
30
,
TimeUnit
.
SECONDS
))
.
isTrue
();
.
isTrue
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment