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
66164bff
Commit
66164bff
authored
Jan 22, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
fbb1ba1b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
36 deletions
+34
-36
JmxEndpointsSupplier.java
...ework/boot/actuate/endpoint/jmx/JmxEndpointsSupplier.java
+1
-0
PathMappedEndpoint.java
...amework/boot/actuate/endpoint/web/PathMappedEndpoint.java
+1
-0
WebEndpointsSupplier.java
...ework/boot/actuate/endpoint/web/WebEndpointsSupplier.java
+1
-0
ControllerEndpointsSupplier.java
.../endpoint/web/annotation/ControllerEndpointsSupplier.java
+1
-0
AbstractWebFluxEndpointHandlerMapping.java
...t/web/reactive/AbstractWebFluxEndpointHandlerMapping.java
+2
-1
AbstractWebMvcEndpointHandlerMapping.java
...int/web/servlet/AbstractWebMvcEndpointHandlerMapping.java
+2
-1
ControllerEndpointHandlerMappingIntegrationTests.java
...ive/ControllerEndpointHandlerMappingIntegrationTests.java
+13
-17
ControllerEndpointHandlerMappingIntegrationTests.java
...let/ControllerEndpointHandlerMappingIntegrationTests.java
+13
-17
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointsSupplier.java
View file @
66164bff
...
@@ -24,6 +24,7 @@ import org.springframework.boot.actuate.endpoint.EndpointsSupplier;
...
@@ -24,6 +24,7 @@ import org.springframework.boot.actuate.endpoint.EndpointsSupplier;
* @author Phillip Webb
* @author Phillip Webb
* @since 2.0.0
* @since 2.0.0
*/
*/
@FunctionalInterface
public
interface
JmxEndpointsSupplier
extends
EndpointsSupplier
<
ExposableJmxEndpoint
>
{
public
interface
JmxEndpointsSupplier
extends
EndpointsSupplier
<
ExposableJmxEndpoint
>
{
}
}
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpoint.java
View file @
66164bff
...
@@ -26,6 +26,7 @@ import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
...
@@ -26,6 +26,7 @@ import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
* @since 2.0.0
* @since 2.0.0
* @see PathMapper
* @see PathMapper
*/
*/
@FunctionalInterface
public
interface
PathMappedEndpoint
{
public
interface
PathMappedEndpoint
{
/**
/**
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/WebEndpointsSupplier.java
View file @
66164bff
...
@@ -24,6 +24,7 @@ import org.springframework.boot.actuate.endpoint.EndpointsSupplier;
...
@@ -24,6 +24,7 @@ import org.springframework.boot.actuate.endpoint.EndpointsSupplier;
* @author Phillip Webb
* @author Phillip Webb
* @since 2.0.0
* @since 2.0.0
*/
*/
@FunctionalInterface
public
interface
WebEndpointsSupplier
extends
EndpointsSupplier
<
ExposableWebEndpoint
>
{
public
interface
WebEndpointsSupplier
extends
EndpointsSupplier
<
ExposableWebEndpoint
>
{
}
}
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointsSupplier.java
View file @
66164bff
...
@@ -24,6 +24,7 @@ import org.springframework.boot.actuate.endpoint.EndpointsSupplier;
...
@@ -24,6 +24,7 @@ import org.springframework.boot.actuate.endpoint.EndpointsSupplier;
* @author Phillip Webb
* @author Phillip Webb
* @since 2.0.0
* @since 2.0.0
*/
*/
@FunctionalInterface
public
interface
ControllerEndpointsSupplier
public
interface
ControllerEndpointsSupplier
extends
EndpointsSupplier
<
ExposableControllerEndpoint
>
{
extends
EndpointsSupplier
<
ExposableControllerEndpoint
>
{
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java
View file @
66164bff
...
@@ -238,8 +238,9 @@ public abstract class AbstractWebFluxEndpointHandlerMapping
...
@@ -238,8 +238,9 @@ public abstract class AbstractWebFluxEndpointHandlerMapping
}
}
/**
/**
* A
n
reactive web operation that can be handled by WebFlux.
* A reactive web operation that can be handled by WebFlux.
*/
*/
@FunctionalInterface
protected
interface
ReactiveWebOperation
{
protected
interface
ReactiveWebOperation
{
Mono
<
ResponseEntity
<
Object
>>
handle
(
ServerWebExchange
exchange
,
Mono
<
ResponseEntity
<
Object
>>
handle
(
ServerWebExchange
exchange
,
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java
View file @
66164bff
...
@@ -214,8 +214,9 @@ public abstract class AbstractWebMvcEndpointHandlerMapping
...
@@ -214,8 +214,9 @@ public abstract class AbstractWebMvcEndpointHandlerMapping
}
}
/**
/**
* A
n reactive web operation that can be handled by WebFlux
.
* A
servlet web operation that can be handled by Spring MVC
.
*/
*/
@FunctionalInterface
protected
interface
ServletWebOperation
{
protected
interface
ServletWebOperation
{
Object
handle
(
HttpServletRequest
request
,
Map
<
String
,
String
>
body
);
Object
handle
(
HttpServletRequest
request
,
Map
<
String
,
String
>
body
);
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java
View file @
66164bff
...
@@ -68,31 +68,27 @@ public class ControllerEndpointHandlerMappingIntegrationTests {
...
@@ -68,31 +68,27 @@ public class ControllerEndpointHandlerMappingIntegrationTests {
@Test
@Test
public
void
get
()
{
public
void
get
()
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
->
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
.
get
().
uri
(
"/actuator/example/one"
).
accept
(
MediaType
.
TEXT_PLAIN
)
(
webTestClient
)
->
webTestClient
.
get
().
uri
(
"/actuator/example/one"
)
.
exchange
().
expectStatus
().
isOk
().
expectHeader
()
.
accept
(
MediaType
.
TEXT_PLAIN
).
exchange
().
expectStatus
().
isOk
()
.
contentTypeCompatibleWith
(
MediaType
.
TEXT_PLAIN
)
.
expectHeader
().
contentTypeCompatibleWith
(
MediaType
.
TEXT_PLAIN
)
.
expectBody
(
String
.
class
).
isEqualTo
(
"One"
);
.
expectBody
(
String
.
class
).
isEqualTo
(
"One"
)));
}));
}
}
@Test
@Test
public
void
getWithUnacceptableContentType
()
{
public
void
getWithUnacceptableContentType
()
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
->
{
this
.
contextRunner
.
run
(
withWebTestClient
((
webTestClient
)
->
webTestClient
.
get
()
webTestClient
.
get
().
uri
(
"/actuator/example/one"
)
.
uri
(
"/actuator/example/one"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
accept
(
MediaType
.
APPLICATION_JSON
).
exchange
().
expectStatus
()
.
exchange
().
expectStatus
().
isEqualTo
(
HttpStatus
.
NOT_ACCEPTABLE
)));
.
isEqualTo
(
HttpStatus
.
NOT_ACCEPTABLE
);
}));
}
}
@Test
@Test
public
void
post
()
{
public
void
post
()
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
->
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
.
post
().
uri
(
"/actuator/example/two"
)
(
webTestClient
)
->
webTestClient
.
post
().
uri
(
"/actuator/example/two"
)
.
syncBody
(
Collections
.
singletonMap
(
"id"
,
"test"
)).
exchange
()
.
syncBody
(
Collections
.
singletonMap
(
"id"
,
"test"
)).
exchange
()
.
expectStatus
().
isCreated
().
expectHeader
()
.
expectStatus
().
isCreated
().
expectHeader
()
.
valueEquals
(
HttpHeaders
.
LOCATION
,
"/example/test"
);
.
valueEquals
(
HttpHeaders
.
LOCATION
,
"/example/test"
)));
}));
}
}
private
ContextConsumer
<
AssertableReactiveWebApplicationContext
>
withWebTestClient
(
private
ContextConsumer
<
AssertableReactiveWebApplicationContext
>
withWebTestClient
(
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java
View file @
66164bff
...
@@ -67,31 +67,27 @@ public class ControllerEndpointHandlerMappingIntegrationTests {
...
@@ -67,31 +67,27 @@ public class ControllerEndpointHandlerMappingIntegrationTests {
@Test
@Test
public
void
get
()
{
public
void
get
()
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
->
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
.
get
().
uri
(
"/actuator/example/one"
).
accept
(
MediaType
.
TEXT_PLAIN
)
(
webTestClient
)
->
webTestClient
.
get
().
uri
(
"/actuator/example/one"
)
.
exchange
().
expectStatus
().
isOk
().
expectHeader
()
.
accept
(
MediaType
.
TEXT_PLAIN
).
exchange
().
expectStatus
().
isOk
()
.
contentTypeCompatibleWith
(
MediaType
.
TEXT_PLAIN
)
.
expectHeader
().
contentTypeCompatibleWith
(
MediaType
.
TEXT_PLAIN
)
.
expectBody
(
String
.
class
).
isEqualTo
(
"One"
);
.
expectBody
(
String
.
class
).
isEqualTo
(
"One"
)));
}));
}
}
@Test
@Test
public
void
getWithUnacceptableContentType
()
{
public
void
getWithUnacceptableContentType
()
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
->
{
this
.
contextRunner
.
run
(
withWebTestClient
((
webTestClient
)
->
webTestClient
.
get
()
webTestClient
.
get
().
uri
(
"/actuator/example/one"
)
.
uri
(
"/actuator/example/one"
).
accept
(
MediaType
.
APPLICATION_JSON
)
.
accept
(
MediaType
.
APPLICATION_JSON
).
exchange
().
expectStatus
()
.
exchange
().
expectStatus
().
isEqualTo
(
HttpStatus
.
NOT_ACCEPTABLE
)));
.
isEqualTo
(
HttpStatus
.
NOT_ACCEPTABLE
);
}));
}
}
@Test
@Test
public
void
post
()
{
public
void
post
()
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
->
{
this
.
contextRunner
.
run
(
withWebTestClient
(
webTestClient
.
post
().
uri
(
"/actuator/example/two"
)
(
webTestClient
)
->
webTestClient
.
post
().
uri
(
"/actuator/example/two"
)
.
syncBody
(
Collections
.
singletonMap
(
"id"
,
"test"
)).
exchange
()
.
syncBody
(
Collections
.
singletonMap
(
"id"
,
"test"
)).
exchange
()
.
expectStatus
().
isCreated
().
expectHeader
()
.
expectStatus
().
isCreated
().
expectHeader
()
.
valueEquals
(
HttpHeaders
.
LOCATION
,
"/example/test"
);
.
valueEquals
(
HttpHeaders
.
LOCATION
,
"/example/test"
)));
}));
}
}
private
ContextConsumer
<
AssertableWebApplicationContext
>
withWebTestClient
(
private
ContextConsumer
<
AssertableWebApplicationContext
>
withWebTestClient
(
...
...
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