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
32102c69
Commit
32102c69
authored
Sep 25, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using classes from spring-web in core web endpoint infrastructure
Closes gh-10358
parent
3fcaa976
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
29 deletions
+19
-29
EndpointAutoConfiguration.java
...ate/autoconfigure/endpoint/EndpointAutoConfiguration.java
+1
-1
ActuatorMediaType.java
...amework/boot/actuate/endpoint/http/ActuatorMediaType.java
+5
-17
JerseyEndpointsRunner.java
...boot/actuate/endpoint/web/test/JerseyEndpointsRunner.java
+1
-1
WebFluxEndpointsRunner.java
...oot/actuate/endpoint/web/test/WebFluxEndpointsRunner.java
+1
-1
WebMvcEndpointRunner.java
.../boot/actuate/endpoint/web/test/WebMvcEndpointRunner.java
+1
-1
LoggersEndpointWebIntegrationTests.java
...ot/actuate/logger/LoggersEndpointWebIntegrationTests.java
+4
-4
import-control.xml
spring-boot-parent/src/checkstyle/import-control.xml
+6
-4
No files found.
spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/EndpointAutoConfiguration.java
View file @
32102c69
...
...
@@ -63,7 +63,7 @@ public class EndpointAutoConfiguration {
static
class
EndpointWebConfiguration
{
private
static
final
List
<
String
>
MEDIA_TYPES
=
Arrays
.
asList
(
ActuatorMediaType
.
V2_JSON
_VALUE
,
"application/json"
);
.
asList
(
ActuatorMediaType
.
V2_JSON
,
"application/json"
);
private
final
ApplicationContext
applicationContext
;
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/http/ActuatorMediaType.java
View file @
32102c69
...
...
@@ -16,10 +16,8 @@
package
org
.
springframework
.
boot
.
actuate
.
endpoint
.
http
;
import
org.springframework.http.MediaType
;
/**
*
{@link MediaType MediaTypes}
that can be consumed and produced by Actuator endpoints.
*
Media types
that can be consumed and produced by Actuator endpoints.
*
* @author Andy Wilkinson
* @author Madhura Bhave
...
...
@@ -28,24 +26,14 @@ import org.springframework.http.MediaType;
public
final
class
ActuatorMediaType
{
/**
* {@link String} equivalent of {@link #V1_JSON}.
*/
public
static
final
String
V1_JSON_VALUE
=
"application/vnd.spring-boot.actuator.v1+json"
;
/**
* {@link String} equivalent of {@link #V2_JSON}.
*/
public
static
final
String
V2_JSON_VALUE
=
"application/vnd.spring-boot.actuator.v2+json"
;
/**
* The {@code application/vnd.spring-boot.actuator.v1+json} media type.
* Constant for the Actuator V1 media type.
*/
public
static
final
MediaType
V1_JSON
=
MediaType
.
valueOf
(
V1_JSON_VALUE
)
;
public
static
final
String
V1_JSON
=
"application/vnd.spring-boot.actuator.v1+json"
;
/**
*
The {@code application/vnd.spring-boot.actuator.v2+json}
media type.
*
Constant for the Actuator V2
media type.
*/
public
static
final
MediaType
V2_JSON
=
MediaType
.
valueOf
(
V2_JSON_VALUE
)
;
public
static
final
String
V2_JSON
=
"application/vnd.spring-boot.actuator.v2+json"
;
private
ActuatorMediaType
()
{
}
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/JerseyEndpointsRunner.java
View file @
32102c69
...
...
@@ -91,7 +91,7 @@ class JerseyEndpointsRunner extends AbstractWebEndpointRunner {
private
void
customize
(
ResourceConfig
config
)
{
List
<
String
>
mediaTypes
=
Arrays
.
asList
(
MediaType
.
APPLICATION_JSON_VALUE
,
ActuatorMediaType
.
V2_JSON
_VALUE
);
ActuatorMediaType
.
V2_JSON
);
WebAnnotationEndpointDiscoverer
discoverer
=
new
WebAnnotationEndpointDiscoverer
(
this
.
applicationContext
,
new
ConversionServiceOperationParameterMapper
(),
(
id
)
->
null
,
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebFluxEndpointsRunner.java
View file @
32102c69
...
...
@@ -98,7 +98,7 @@ class WebFluxEndpointsRunner extends AbstractWebEndpointRunner {
@Bean
public
WebFluxEndpointHandlerMapping
webEndpointReactiveHandlerMapping
()
{
List
<
String
>
mediaTypes
=
Arrays
.
asList
(
MediaType
.
APPLICATION_JSON_VALUE
,
ActuatorMediaType
.
V2_JSON
_VALUE
);
ActuatorMediaType
.
V2_JSON
);
WebAnnotationEndpointDiscoverer
discoverer
=
new
WebAnnotationEndpointDiscoverer
(
this
.
applicationContext
,
new
ConversionServiceOperationParameterMapper
(),
(
id
)
->
null
,
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebMvcEndpointRunner.java
View file @
32102c69
...
...
@@ -81,7 +81,7 @@ class WebMvcEndpointRunner extends AbstractWebEndpointRunner {
@Bean
public
WebMvcEndpointHandlerMapping
webEndpointServletHandlerMapping
()
{
List
<
String
>
mediaTypes
=
Arrays
.
asList
(
MediaType
.
APPLICATION_JSON_VALUE
,
ActuatorMediaType
.
V2_JSON
_VALUE
);
ActuatorMediaType
.
V2_JSON
);
WebAnnotationEndpointDiscoverer
discoverer
=
new
WebAnnotationEndpointDiscoverer
(
this
.
applicationContext
,
new
ConversionServiceOperationParameterMapper
(),
(
id
)
->
null
,
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/logger/LoggersEndpointWebIntegrationTests.java
View file @
32102c69
...
...
@@ -116,7 +116,7 @@ public class LoggersEndpointWebIntegrationTests {
@Test
public
void
setLoggerUsingActuatorV2JsonShouldSetLogLevel
()
throws
Exception
{
client
.
post
().
uri
(
"/application/loggers/ROOT"
)
.
contentType
(
ActuatorMediaType
.
V2_JSON
)
.
contentType
(
MediaType
.
parseMediaType
(
ActuatorMediaType
.
V2_JSON
)
)
.
syncBody
(
Collections
.
singletonMap
(
"configuredLevel"
,
"debug"
)).
exchange
()
.
expectStatus
().
isNoContent
();
verify
(
this
.
loggingSystem
).
setLogLevel
(
"ROOT"
,
LogLevel
.
DEBUG
);
...
...
@@ -134,7 +134,7 @@ public class LoggersEndpointWebIntegrationTests {
@Test
public
void
setLoggerWithNullLogLevel
()
throws
Exception
{
client
.
post
().
uri
(
"/application/loggers/ROOT"
)
.
contentType
(
ActuatorMediaType
.
V2_JSON
)
.
contentType
(
MediaType
.
parseMediaType
(
ActuatorMediaType
.
V2_JSON
)
)
.
syncBody
(
Collections
.
singletonMap
(
"configuredLevel"
,
null
)).
exchange
()
.
expectStatus
().
isNoContent
();
verify
(
this
.
loggingSystem
).
setLogLevel
(
"ROOT"
,
null
);
...
...
@@ -143,8 +143,8 @@ public class LoggersEndpointWebIntegrationTests {
@Test
public
void
setLoggerWithNoLogLevel
()
throws
Exception
{
client
.
post
().
uri
(
"/application/loggers/ROOT"
)
.
contentType
(
ActuatorMediaType
.
V2_JSON
).
syncBody
(
Collections
.
emptyMap
(
))
.
exchange
().
expectStatus
().
isNoContent
();
.
contentType
(
MediaType
.
parseMediaType
(
ActuatorMediaType
.
V2_JSON
))
.
syncBody
(
Collections
.
emptyMap
()).
exchange
().
expectStatus
().
isNoContent
();
verify
(
this
.
loggingSystem
).
setLogLevel
(
"ROOT"
,
null
);
}
...
...
spring-boot-parent/src/checkstyle/import-control.xml
View file @
32102c69
...
...
@@ -30,17 +30,19 @@
</subpackage>
<!-- Endpoint infrastructure -->
<subpackage
name=
"endpoint"
>
<subpackage
name=
"
actuate.
endpoint"
>
<disallow
pkg=
"org.springframework.http"
/>
<disallow
pkg=
"org.springframework.web"
/>
<subpackage
name=
"web"
>
<allow
pkg=
"org.springframework.http"
/>
<allow
pkg=
"org.springframework.web"
/>
<subpackage
name=
"mvc"
>
<subpackage
name=
"servlet"
>
<disallow
pkg=
"org.springframework.web.reactive"
/>
<allow
pkg=
"org.springframework.http"
/>
<allow
pkg=
"org.springframework.web"
/>
</subpackage>
<subpackage
name=
"reactive"
>
<disallow
pkg=
"org.springframework.web.servlet"
/>
<allow
pkg=
"org.springframework.http"
/>
<allow
pkg=
"org.springframework.web"
/>
</subpackage>
</subpackage>
</subpackage>
...
...
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