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
1e2e8b1d
Commit
1e2e8b1d
authored
Mar 20, 2018
by
Johnny Lim
Committed by
Stephane Nicoll
Mar 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename expose to include
Closes gh-12555
parent
40fd8888
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ExposeExcludePropertyEndpointFilter.java
...nfigure/endpoint/ExposeExcludePropertyEndpointFilter.java
+2
-2
ExposeExcludePropertyEndpointFilterTests.java
...re/endpoint/ExposeExcludePropertyEndpointFilterTests.java
+3
-3
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilter.java
View file @
1e2e8b1d
...
@@ -33,7 +33,7 @@ import org.springframework.core.env.Environment;
...
@@ -33,7 +33,7 @@ import org.springframework.core.env.Environment;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
/**
/**
* {@link EndpointFilter} that will filter endpoints based on {@code
expos
e} and
* {@link EndpointFilter} that will filter endpoints based on {@code
includ
e} and
* {@code exclude} properties.
* {@code exclude} properties.
*
*
* @param <E> The endpoint type
* @param <E> The endpoint type
...
@@ -58,7 +58,7 @@ public class ExposeExcludePropertyEndpointFilter<E extends ExposableEndpoint<?>>
...
@@ -58,7 +58,7 @@ public class ExposeExcludePropertyEndpointFilter<E extends ExposableEndpoint<?>>
Assert
.
hasText
(
prefix
,
"Prefix must not be empty"
);
Assert
.
hasText
(
prefix
,
"Prefix must not be empty"
);
Binder
binder
=
Binder
.
get
(
environment
);
Binder
binder
=
Binder
.
get
(
environment
);
this
.
endpointType
=
endpointType
;
this
.
endpointType
=
endpointType
;
this
.
include
=
bind
(
binder
,
prefix
+
".
expos
e"
);
this
.
include
=
bind
(
binder
,
prefix
+
".
includ
e"
);
this
.
exclude
=
bind
(
binder
,
prefix
+
".exclude"
);
this
.
exclude
=
bind
(
binder
,
prefix
+
".exclude"
);
this
.
exposeDefaults
=
asSet
(
Arrays
.
asList
(
exposeDefaults
));
this
.
exposeDefaults
=
asSet
(
Arrays
.
asList
(
exposeDefaults
));
}
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilterTests.java
View file @
1e2e8b1d
...
@@ -123,7 +123,7 @@ public class ExposeExcludePropertyEndpointFilterTests {
...
@@ -123,7 +123,7 @@ public class ExposeExcludePropertyEndpointFilterTests {
@Test
@Test
public
void
matchWhenDiscovererDoesNotMatchShouldMatch
()
{
public
void
matchWhenDiscovererDoesNotMatchShouldMatch
()
{
MockEnvironment
environment
=
new
MockEnvironment
();
MockEnvironment
environment
=
new
MockEnvironment
();
environment
.
setProperty
(
"foo.
expos
e"
,
"bar"
);
environment
.
setProperty
(
"foo.
includ
e"
,
"bar"
);
environment
.
setProperty
(
"foo.exclude"
,
""
);
environment
.
setProperty
(
"foo.exclude"
,
""
);
this
.
filter
=
new
ExposeExcludePropertyEndpointFilter
<>(
this
.
filter
=
new
ExposeExcludePropertyEndpointFilter
<>(
DifferentTestExposableWebEndpoint
.
class
,
environment
,
"foo"
);
DifferentTestExposableWebEndpoint
.
class
,
environment
,
"foo"
);
...
@@ -146,9 +146,9 @@ public class ExposeExcludePropertyEndpointFilterTests {
...
@@ -146,9 +146,9 @@ public class ExposeExcludePropertyEndpointFilterTests {
assertThat
(
match
(
"buz"
)).
isFalse
();
assertThat
(
match
(
"buz"
)).
isFalse
();
}
}
private
void
setupFilter
(
String
expos
e
,
String
exclude
)
{
private
void
setupFilter
(
String
includ
e
,
String
exclude
)
{
MockEnvironment
environment
=
new
MockEnvironment
();
MockEnvironment
environment
=
new
MockEnvironment
();
environment
.
setProperty
(
"foo.
expose"
,
expos
e
);
environment
.
setProperty
(
"foo.
include"
,
includ
e
);
environment
.
setProperty
(
"foo.exclude"
,
exclude
);
environment
.
setProperty
(
"foo.exclude"
,
exclude
);
this
.
filter
=
new
ExposeExcludePropertyEndpointFilter
<>(
this
.
filter
=
new
ExposeExcludePropertyEndpointFilter
<>(
TestExposableWebEndpoint
.
class
,
environment
,
"foo"
,
"def"
);
TestExposableWebEndpoint
.
class
,
environment
,
"foo"
,
"def"
);
...
...
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