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
71cf0a3e
Commit
71cf0a3e
authored
Aug 08, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.1.x'
Closes gh-17812
parents
845f2d06
b31c3362
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
EndpointDiscoverer.java
.../boot/actuate/endpoint/annotation/EndpointDiscoverer.java
+2
-2
EndpointDiscovererTests.java
.../actuate/endpoint/annotation/EndpointDiscovererTests.java
+29
-0
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java
View file @
71cf0a3e
...
...
@@ -466,8 +466,8 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
ExtensionBean
(
String
beanName
,
Object
bean
)
{
this
.
bean
=
bean
;
this
.
beanName
=
beanName
;
MergedAnnotation
<
EndpointExtension
>
extensionAnnotation
=
MergedAnnotations
.
from
(
bean
.
getClass
())
.
get
(
EndpointExtension
.
class
);
MergedAnnotation
<
EndpointExtension
>
extensionAnnotation
=
MergedAnnotations
.
from
(
bean
.
getClass
(),
SearchStrategy
.
TYPE_HIERARCHY
).
get
(
EndpointExtension
.
class
);
Class
<?>
endpointType
=
extensionAnnotation
.
getClass
(
"endpoint"
);
MergedAnnotation
<
Endpoint
>
endpointAnnotation
=
MergedAnnotations
.
from
(
endpointType
,
SearchStrategy
.
TYPE_HIERARCHY
).
get
(
Endpoint
.
class
);
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java
View file @
71cf0a3e
...
...
@@ -44,6 +44,8 @@ import org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper;
import
org.springframework.boot.actuate.endpoint.invoke.convert.ConversionServiceParameterValueMapper
;
import
org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvoker
;
import
org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor
;
import
org.springframework.cglib.proxy.Enhancer
;
import
org.springframework.cglib.proxy.FixedValue
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -236,6 +238,15 @@ class EndpointDiscovererTests {
});
}
@Test
void
getEndpointsWhenHasProxiedEndpointShouldReturnEndpoint
()
{
load
(
ProxiedSpecializedEndpointsConfiguration
.
class
,
(
context
)
->
{
SpecializedEndpointDiscoverer
discoverer
=
new
SpecializedEndpointDiscoverer
(
context
);
Map
<
EndpointId
,
SpecializedExposableEndpoint
>
endpoints
=
mapEndpoints
(
discoverer
.
getEndpoints
());
assertThat
(
endpoints
).
containsOnlyKeys
(
EndpointId
.
of
(
"test"
),
EndpointId
.
of
(
"specialized"
));
});
}
@Test
void
getEndpointsShouldApplyFilters
()
{
load
(
SpecializedEndpointsConfiguration
.
class
,
(
context
)
->
{
...
...
@@ -327,6 +338,19 @@ class EndpointDiscovererTests {
}
@Configuration
(
proxyBeanMethods
=
false
)
static
class
ProxiedSpecializedTestEndpointConfiguration
{
@Bean
SpecializedExtension
specializedExtension
()
{
Enhancer
enhancer
=
new
Enhancer
();
enhancer
.
setSuperclass
(
SpecializedExtension
.
class
);
enhancer
.
setCallback
((
FixedValue
)
()
->
null
);
return
(
SpecializedExtension
)
enhancer
.
create
();
}
}
@Configuration
(
proxyBeanMethods
=
false
)
static
class
TestEndpointConfiguration
{
...
...
@@ -387,6 +411,11 @@ class EndpointDiscovererTests {
}
@Import
({
TestEndpoint
.
class
,
SpecializedTestEndpoint
.
class
,
ProxiedSpecializedTestEndpointConfiguration
.
class
})
static
class
ProxiedSpecializedEndpointsConfiguration
{
}
@Endpoint
(
id
=
"test"
)
static
class
TestEndpoint
{
...
...
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