Skip to content

Commit 8de0027

Browse files
committed
Merge branch '2.2.x'
Closes gh-21062
2 parents 03a9738 + 3065c88 commit 8de0027

File tree

8 files changed

+41
-40
lines changed

8 files changed

+41
-40
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import java.util.Collection;
2020

21-
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter;
21+
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter;
2222
import org.springframework.boot.actuate.endpoint.EndpointFilter;
2323
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
2424
import org.springframework.core.env.Environment;
@@ -30,11 +30,11 @@
3030
* @param <E> the endpoint type
3131
* @author Phillip Webb
3232
* @since 2.0.0
33-
* @deprecated since 2.2.7 in favor of {@link IncludExcludeEndpointFilter}
33+
* @deprecated since 2.2.7 in favor of {@link IncludeExcludeEndpointFilter}
3434
*/
3535
@Deprecated
3636
public class ExposeExcludePropertyEndpointFilter<E extends ExposableEndpoint<?>>
37-
extends IncludExcludeEndpointFilter<E> {
37+
extends IncludeExcludeEndpointFilter<E> {
3838

3939
public ExposeExcludePropertyEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
4040
String... exposeDefaults) {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import java.util.Map;
2121
import java.util.Set;
2222

23-
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter;
24-
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter.DefaultIncludes;
23+
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter;
24+
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter.DefaultIncludes;
2525
import org.springframework.boot.actuate.endpoint.EndpointId;
2626
import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
2727
import org.springframework.boot.autoconfigure.condition.ConditionMessage;
@@ -87,7 +87,7 @@ private Set<Exposure> getExposures(Environment environment) {
8787
return exposures;
8888
}
8989

90-
static class Exposure extends IncludExcludeEndpointFilter<ExposableEndpoint<?>> {
90+
static class Exposure extends IncludeExcludeEndpointFilter<ExposableEndpoint<?>> {
9191

9292
private final String prefix;
9393

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* @author Phillip Webb
4141
* @since 2.2.7
4242
*/
43-
public class IncludExcludeEndpointFilter<E extends ExposableEndpoint<?>> implements EndpointFilter<E> {
43+
public class IncludeExcludeEndpointFilter<E extends ExposableEndpoint<?>> implements EndpointFilter<E> {
4444

4545
private final Class<E> endpointType;
4646

@@ -51,34 +51,34 @@ public class IncludExcludeEndpointFilter<E extends ExposableEndpoint<?>> impleme
5151
private final EndpointPatterns exclude;
5252

5353
/**
54-
* Create a new {@link IncludExcludeEndpointFilter} with include/exclude rules bound
54+
* Create a new {@link IncludeExcludeEndpointFilter} with include/exclude rules bound
5555
* from the {@link Environment}.
5656
* @param endpointType the endpoint type that should be considered (other types always
5757
* match)
5858
* @param environment the environment containing the properties
5959
* @param prefix the property prefix to bind
6060
* @param defaultIncludes the default {@code includes} to use when none are specified.
6161
*/
62-
public IncludExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
62+
public IncludeExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
6363
String... defaultIncludes) {
6464
this(endpointType, environment, prefix, new EndpointPatterns(defaultIncludes));
6565
}
6666

6767
/**
68-
* Create a new {@link IncludExcludeEndpointFilter} with include/exclude rules bound
68+
* Create a new {@link IncludeExcludeEndpointFilter} with include/exclude rules bound
6969
* from the {@link Environment}.
7070
* @param endpointType the endpoint type that should be considered (other types always
7171
* match)
7272
* @param environment the environment containing the properties
7373
* @param prefix the property prefix to bind
7474
* @param defaultIncludes the default {@code includes} to use when none are specified.
7575
*/
76-
public IncludExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
76+
public IncludeExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
7777
DefaultIncludes defaultIncludes) {
7878
this(endpointType, environment, prefix, DefaultIncludes.patterns(defaultIncludes));
7979
}
8080

81-
private IncludExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
81+
private IncludeExcludeEndpointFilter(Class<E> endpointType, Environment environment, String prefix,
8282
EndpointPatterns defaultIncludes) {
8383
Assert.notNull(endpointType, "EndpointType must not be null");
8484
Assert.notNull(environment, "Environment must not be null");
@@ -92,34 +92,34 @@ private IncludExcludeEndpointFilter(Class<E> endpointType, Environment environme
9292
}
9393

9494
/**
95-
* Create a new {@link IncludExcludeEndpointFilter} with specific include/exclude
95+
* Create a new {@link IncludeExcludeEndpointFilter} with specific include/exclude
9696
* rules.
9797
* @param endpointType the endpoint type that should be considered (other types always
9898
* match)
9999
* @param include the include patterns
100100
* @param exclude the exclude patterns
101101
* @param defaultIncludes the default {@code includes} to use when none are specified.
102102
*/
103-
public IncludExcludeEndpointFilter(Class<E> endpointType, Collection<String> include, Collection<String> exclude,
103+
public IncludeExcludeEndpointFilter(Class<E> endpointType, Collection<String> include, Collection<String> exclude,
104104
String... defaultIncludes) {
105105
this(endpointType, include, exclude, new EndpointPatterns(defaultIncludes));
106106
}
107107

108108
/**
109-
* Create a new {@link IncludExcludeEndpointFilter} with specific include/exclude
109+
* Create a new {@link IncludeExcludeEndpointFilter} with specific include/exclude
110110
* rules.
111111
* @param endpointType the endpoint type that should be considered (other types always
112112
* match)
113113
* @param include the include patterns
114114
* @param exclude the exclude patterns
115115
* @param defaultIncludes the default {@code includes} to use when none are specified.
116116
*/
117-
public IncludExcludeEndpointFilter(Class<E> endpointType, Collection<String> include, Collection<String> exclude,
117+
public IncludeExcludeEndpointFilter(Class<E> endpointType, Collection<String> include, Collection<String> exclude,
118118
DefaultIncludes defaultIncludes) {
119119
this(endpointType, include, exclude, DefaultIncludes.patterns(defaultIncludes));
120120
}
121121

122-
private IncludExcludeEndpointFilter(Class<E> endpointType, Collection<String> include, Collection<String> exclude,
122+
private IncludeExcludeEndpointFilter(Class<E> endpointType, Collection<String> include, Collection<String> exclude,
123123
EndpointPatterns defaultIncludes) {
124124
Assert.notNull(endpointType, "EndpointType Type must not be null");
125125
Assert.notNull(defaultIncludes, "DefaultIncludes must not be null");

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import com.fasterxml.jackson.databind.ObjectMapper;
2424

2525
import org.springframework.beans.factory.ObjectProvider;
26-
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter;
26+
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter;
2727
import org.springframework.boot.actuate.endpoint.EndpointFilter;
2828
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
2929
import org.springframework.boot.actuate.endpoint.invoke.OperationInvokerAdvisor;
@@ -97,9 +97,9 @@ public JmxEndpointExporter jmxMBeanExporter(MBeanServer mBeanServer, Environment
9797
}
9898

9999
@Bean
100-
public IncludExcludeEndpointFilter<ExposableJmxEndpoint> jmxIncludeExcludePropertyEndpointFilter() {
100+
public IncludeExcludeEndpointFilter<ExposableJmxEndpoint> jmxIncludeExcludePropertyEndpointFilter() {
101101
JmxEndpointProperties.Exposure exposure = this.properties.getExposure();
102-
return new IncludExcludeEndpointFilter<>(ExposableJmxEndpoint.class, exposure.getInclude(),
102+
return new IncludeExcludeEndpointFilter<>(ExposableJmxEndpoint.class, exposure.getInclude(),
103103
exposure.getExclude(), "*");
104104
}
105105

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.glassfish.jersey.server.ResourceConfig;
2020

21-
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter;
21+
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter;
2222
import org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration;
2323
import org.springframework.boot.actuate.endpoint.web.ExposableServletEndpoint;
2424
import org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar;
@@ -47,10 +47,10 @@
4747
public class ServletEndpointManagementContextConfiguration {
4848

4949
@Bean
50-
public IncludExcludeEndpointFilter<ExposableServletEndpoint> servletExposeExcludePropertyEndpointFilter(
50+
public IncludeExcludeEndpointFilter<ExposableServletEndpoint> servletExposeExcludePropertyEndpointFilter(
5151
WebEndpointProperties properties) {
5252
WebEndpointProperties.Exposure exposure = properties.getExposure();
53-
return new IncludExcludeEndpointFilter<>(ExposableServletEndpoint.class, exposure.getInclude(),
53+
return new IncludeExcludeEndpointFilter<>(ExposableServletEndpoint.class, exposure.getInclude(),
5454
exposure.getExclude());
5555
}
5656

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
import org.springframework.beans.factory.ObjectProvider;
2424
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
25-
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter;
26-
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter.DefaultIncludes;
25+
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter;
26+
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter.DefaultIncludes;
2727
import org.springframework.boot.actuate.endpoint.EndpointFilter;
2828
import org.springframework.boot.actuate.endpoint.EndpointsSupplier;
2929
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
@@ -113,16 +113,16 @@ public PathMappedEndpoints pathMappedEndpoints(Collection<EndpointsSupplier<?>>
113113
}
114114

115115
@Bean
116-
public IncludExcludeEndpointFilter<ExposableWebEndpoint> webExposeExcludePropertyEndpointFilter() {
116+
public IncludeExcludeEndpointFilter<ExposableWebEndpoint> webExposeExcludePropertyEndpointFilter() {
117117
WebEndpointProperties.Exposure exposure = this.properties.getExposure();
118-
return new IncludExcludeEndpointFilter<>(ExposableWebEndpoint.class, exposure.getInclude(),
118+
return new IncludeExcludeEndpointFilter<>(ExposableWebEndpoint.class, exposure.getInclude(),
119119
exposure.getExclude(), DefaultIncludes.WEB);
120120
}
121121

122122
@Bean
123-
public IncludExcludeEndpointFilter<ExposableControllerEndpoint> controllerExposeExcludePropertyEndpointFilter() {
123+
public IncludeExcludeEndpointFilter<ExposableControllerEndpoint> controllerExposeExcludePropertyEndpointFilter() {
124124
WebEndpointProperties.Exposure exposure = this.properties.getExposure();
125-
return new IncludExcludeEndpointFilter<>(ExposableControllerEndpoint.class, exposure.getInclude(),
125+
return new IncludeExcludeEndpointFilter<>(ExposableControllerEndpoint.class, exposure.getInclude(),
126126
exposure.getExclude());
127127
}
128128

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
import static org.mockito.Mockito.mock;
3333

3434
/**
35-
* Tests for {@link IncludExcludeEndpointFilter}.
35+
* Tests for {@link IncludeExcludeEndpointFilter}.
3636
*
3737
* @author Phillip Webb
3838
*/
39-
class IncludExcludeEndpointFilterTests {
39+
class IncludeExcludeEndpointFilterTests {
4040

41-
private IncludExcludeEndpointFilter<?> filter;
41+
private IncludeExcludeEndpointFilter<?> filter;
4242

4343
@BeforeEach
4444
void setup() {
@@ -48,29 +48,30 @@ void setup() {
4848
@Test
4949
void createWhenEndpointTypeIsNullShouldThrowException() {
5050
assertThatIllegalArgumentException()
51-
.isThrownBy(() -> new IncludExcludeEndpointFilter<>(null, new MockEnvironment(), "foo"))
51+
.isThrownBy(() -> new IncludeExcludeEndpointFilter<>(null, new MockEnvironment(), "foo"))
5252
.withMessageContaining("EndpointType must not be null");
5353
}
5454

5555
@Test
5656
void createWhenEnvironmentIsNullShouldThrowException() {
5757
assertThatIllegalArgumentException()
58-
.isThrownBy(() -> new IncludExcludeEndpointFilter<>(ExposableEndpoint.class, null, "foo"))
58+
.isThrownBy(() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, null, "foo"))
5959
.withMessageContaining("Environment must not be null");
6060
}
6161

6262
@Test
6363
void createWhenPrefixIsNullShouldThrowException() {
6464
assertThatIllegalArgumentException()
6565
.isThrownBy(
66-
() -> new IncludExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), null))
66+
() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), null))
6767
.withMessageContaining("Prefix must not be empty");
6868
}
6969

7070
@Test
7171
void createWhenPrefixIsEmptyShouldThrowException() {
7272
assertThatIllegalArgumentException()
73-
.isThrownBy(() -> new IncludExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), ""))
73+
.isThrownBy(
74+
() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), ""))
7475
.withMessageContaining("Prefix must not be empty");
7576
}
7677

@@ -121,7 +122,7 @@ void matchWhenDiscovererDoesNotMatchShouldMatch() {
121122
MockEnvironment environment = new MockEnvironment();
122123
environment.setProperty("foo.include", "bar");
123124
environment.setProperty("foo.exclude", "");
124-
this.filter = new IncludExcludeEndpointFilter<>(DifferentTestExposableWebEndpoint.class, environment, "foo");
125+
this.filter = new IncludeExcludeEndpointFilter<>(DifferentTestExposableWebEndpoint.class, environment, "foo");
125126
assertThat(match(EndpointId.of("baz"))).isTrue();
126127
}
127128

@@ -157,7 +158,7 @@ private void setupFilter(String include, String exclude) {
157158
MockEnvironment environment = new MockEnvironment();
158159
environment.setProperty("foo.include", include);
159160
environment.setProperty("foo.exclude", exclude);
160-
this.filter = new IncludExcludeEndpointFilter<>(TestExposableWebEndpoint.class, environment, "foo", "def");
161+
this.filter = new IncludeExcludeEndpointFilter<>(TestExposableWebEndpoint.class, environment, "foo", "def");
161162
}
162163

163164
@SuppressWarnings({ "rawtypes", "unchecked" })

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.junit.jupiter.api.Test;
2525

2626
import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration;
27-
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter;
27+
import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter;
2828
import org.springframework.boot.actuate.endpoint.EndpointId;
2929
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
3030
import org.springframework.boot.actuate.endpoint.http.ActuatorMediaType;
@@ -104,7 +104,7 @@ void webApplicationConfiguresEndpointDiscoverer() {
104104
@Test
105105
void webApplicationConfiguresExposeExcludePropertyEndpointFilter() {
106106
this.contextRunner
107-
.run((context) -> assertThat(context).getBeans(IncludExcludeEndpointFilter.class).containsKeys(
107+
.run((context) -> assertThat(context).getBeans(IncludeExcludeEndpointFilter.class).containsKeys(
108108
"webExposeExcludePropertyEndpointFilter", "controllerExposeExcludePropertyEndpointFilter"));
109109
}
110110

0 commit comments

Comments
 (0)