diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilter.java index 0d8ea77f5c6..b0d290fc9e6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilter.java @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.endpoint; import java.util.Collection; -import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter; +import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter; import org.springframework.boot.actuate.endpoint.EndpointFilter; import org.springframework.boot.actuate.endpoint.ExposableEndpoint; import org.springframework.core.env.Environment; @@ -30,11 +30,11 @@ import org.springframework.core.env.Environment; * @param the endpoint type * @author Phillip Webb * @since 2.0.0 - * @deprecated since 2.2.7 in favor of {@link IncludExcludeEndpointFilter} + * @deprecated since 2.2.7 in favor of {@link IncludeExcludeEndpointFilter} */ @Deprecated public class ExposeExcludePropertyEndpointFilter> - extends IncludExcludeEndpointFilter { + extends IncludeExcludeEndpointFilter { public ExposeExcludePropertyEndpointFilter(Class endpointType, Environment environment, String prefix, String... exposeDefaults) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java index 7e274cb5f75..adc73887f08 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java @@ -20,8 +20,8 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter; -import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter.DefaultIncludes; +import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter; +import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter.DefaultIncludes; import org.springframework.boot.actuate.endpoint.EndpointId; import org.springframework.boot.actuate.endpoint.ExposableEndpoint; import org.springframework.boot.autoconfigure.condition.ConditionMessage; @@ -87,7 +87,7 @@ class OnAvailableEndpointCondition extends AbstractEndpointCondition { return exposures; } - static class Exposure extends IncludExcludeEndpointFilter> { + static class Exposure extends IncludeExcludeEndpointFilter> { private final String prefix; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludExcludeEndpointFilter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java similarity index 87% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludExcludeEndpointFilter.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java index 240c2b62116..970db5bacb3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludExcludeEndpointFilter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilter.java @@ -40,7 +40,7 @@ import org.springframework.util.Assert; * @author Phillip Webb * @since 2.2.7 */ -public class IncludExcludeEndpointFilter> implements EndpointFilter { +public class IncludeExcludeEndpointFilter> implements EndpointFilter { private final Class endpointType; @@ -51,7 +51,7 @@ public class IncludExcludeEndpointFilter> impleme private final EndpointPatterns exclude; /** - * Create a new {@link IncludExcludeEndpointFilter} with include/exclude rules bound + * Create a new {@link IncludeExcludeEndpointFilter} with include/exclude rules bound * from the {@link Environment}. * @param endpointType the endpoint type that should be considered (other types always * match) @@ -59,13 +59,13 @@ public class IncludExcludeEndpointFilter> impleme * @param prefix the property prefix to bind * @param defaultIncludes the default {@code includes} to use when none are specified. */ - public IncludExcludeEndpointFilter(Class endpointType, Environment environment, String prefix, + public IncludeExcludeEndpointFilter(Class endpointType, Environment environment, String prefix, String... defaultIncludes) { this(endpointType, environment, prefix, new EndpointPatterns(defaultIncludes)); } /** - * Create a new {@link IncludExcludeEndpointFilter} with include/exclude rules bound + * Create a new {@link IncludeExcludeEndpointFilter} with include/exclude rules bound * from the {@link Environment}. * @param endpointType the endpoint type that should be considered (other types always * match) @@ -73,12 +73,12 @@ public class IncludExcludeEndpointFilter> impleme * @param prefix the property prefix to bind * @param defaultIncludes the default {@code includes} to use when none are specified. */ - public IncludExcludeEndpointFilter(Class endpointType, Environment environment, String prefix, + public IncludeExcludeEndpointFilter(Class endpointType, Environment environment, String prefix, DefaultIncludes defaultIncludes) { this(endpointType, environment, prefix, DefaultIncludes.patterns(defaultIncludes)); } - private IncludExcludeEndpointFilter(Class endpointType, Environment environment, String prefix, + private IncludeExcludeEndpointFilter(Class endpointType, Environment environment, String prefix, EndpointPatterns defaultIncludes) { Assert.notNull(endpointType, "EndpointType must not be null"); Assert.notNull(environment, "Environment must not be null"); @@ -92,7 +92,7 @@ public class IncludExcludeEndpointFilter> impleme } /** - * Create a new {@link IncludExcludeEndpointFilter} with specific include/exclude + * Create a new {@link IncludeExcludeEndpointFilter} with specific include/exclude * rules. * @param endpointType the endpoint type that should be considered (other types always * match) @@ -100,13 +100,13 @@ public class IncludExcludeEndpointFilter> impleme * @param exclude the exclude patterns * @param defaultIncludes the default {@code includes} to use when none are specified. */ - public IncludExcludeEndpointFilter(Class endpointType, Collection include, Collection exclude, + public IncludeExcludeEndpointFilter(Class endpointType, Collection include, Collection exclude, String... defaultIncludes) { this(endpointType, include, exclude, new EndpointPatterns(defaultIncludes)); } /** - * Create a new {@link IncludExcludeEndpointFilter} with specific include/exclude + * Create a new {@link IncludeExcludeEndpointFilter} with specific include/exclude * rules. * @param endpointType the endpoint type that should be considered (other types always * match) @@ -114,12 +114,12 @@ public class IncludExcludeEndpointFilter> impleme * @param exclude the exclude patterns * @param defaultIncludes the default {@code includes} to use when none are specified. */ - public IncludExcludeEndpointFilter(Class endpointType, Collection include, Collection exclude, + public IncludeExcludeEndpointFilter(Class endpointType, Collection include, Collection exclude, DefaultIncludes defaultIncludes) { this(endpointType, include, exclude, DefaultIncludes.patterns(defaultIncludes)); } - private IncludExcludeEndpointFilter(Class endpointType, Collection include, Collection exclude, + private IncludeExcludeEndpointFilter(Class endpointType, Collection include, Collection exclude, EndpointPatterns defaultIncludes) { Assert.notNull(endpointType, "EndpointType Type must not be null"); Assert.notNull(defaultIncludes, "DefaultIncludes must not be null"); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.java index a85f57cab9a..e221b4465be 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.java @@ -23,7 +23,7 @@ import javax.management.MBeanServer; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter; +import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter; import org.springframework.boot.actuate.endpoint.EndpointFilter; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.invoke.OperationInvokerAdvisor; @@ -97,9 +97,9 @@ public class JmxEndpointAutoConfiguration { } @Bean - public IncludExcludeEndpointFilter jmxIncludeExcludePropertyEndpointFilter() { + public IncludeExcludeEndpointFilter jmxIncludeExcludePropertyEndpointFilter() { JmxEndpointProperties.Exposure exposure = this.properties.getExposure(); - return new IncludExcludeEndpointFilter<>(ExposableJmxEndpoint.class, exposure.getInclude(), + return new IncludeExcludeEndpointFilter<>(ExposableJmxEndpoint.class, exposure.getInclude(), exposure.getExclude(), "*"); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java index be7c01ce03d..21d84757a25 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java @@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.endpoint.web; import org.glassfish.jersey.server.ResourceConfig; -import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter; +import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter; import org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration; import org.springframework.boot.actuate.endpoint.web.ExposableServletEndpoint; import org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar; @@ -47,10 +47,10 @@ import org.springframework.web.servlet.DispatcherServlet; public class ServletEndpointManagementContextConfiguration { @Bean - public IncludExcludeEndpointFilter servletExposeExcludePropertyEndpointFilter( + public IncludeExcludeEndpointFilter servletExposeExcludePropertyEndpointFilter( WebEndpointProperties properties) { WebEndpointProperties.Exposure exposure = properties.getExposure(); - return new IncludExcludeEndpointFilter<>(ExposableServletEndpoint.class, exposure.getInclude(), + return new IncludeExcludeEndpointFilter<>(ExposableServletEndpoint.class, exposure.getInclude(), exposure.getExclude()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java index 0cf1ae247ea..387e82f3d13 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java @@ -22,8 +22,8 @@ import java.util.stream.Collectors; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter; -import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter.DefaultIncludes; +import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter; +import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter.DefaultIncludes; import org.springframework.boot.actuate.endpoint.EndpointFilter; import org.springframework.boot.actuate.endpoint.EndpointsSupplier; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; @@ -113,16 +113,16 @@ public class WebEndpointAutoConfiguration { } @Bean - public IncludExcludeEndpointFilter webExposeExcludePropertyEndpointFilter() { + public IncludeExcludeEndpointFilter webExposeExcludePropertyEndpointFilter() { WebEndpointProperties.Exposure exposure = this.properties.getExposure(); - return new IncludExcludeEndpointFilter<>(ExposableWebEndpoint.class, exposure.getInclude(), + return new IncludeExcludeEndpointFilter<>(ExposableWebEndpoint.class, exposure.getInclude(), exposure.getExclude(), DefaultIncludes.WEB); } @Bean - public IncludExcludeEndpointFilter controllerExposeExcludePropertyEndpointFilter() { + public IncludeExcludeEndpointFilter controllerExposeExcludePropertyEndpointFilter() { WebEndpointProperties.Exposure exposure = this.properties.getExposure(); - return new IncludExcludeEndpointFilter<>(ExposableControllerEndpoint.class, exposure.getInclude(), + return new IncludeExcludeEndpointFilter<>(ExposableControllerEndpoint.class, exposure.getInclude(), exposure.getExclude()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludExcludeEndpointFilterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java similarity index 86% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludExcludeEndpointFilterTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java index fb9e61a50e6..66f332b451c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludExcludeEndpointFilterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludeExcludeEndpointFilterTests.java @@ -32,13 +32,13 @@ import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; /** - * Tests for {@link IncludExcludeEndpointFilter}. + * Tests for {@link IncludeExcludeEndpointFilter}. * * @author Phillip Webb */ -class IncludExcludeEndpointFilterTests { +class IncludeExcludeEndpointFilterTests { - private IncludExcludeEndpointFilter filter; + private IncludeExcludeEndpointFilter filter; @BeforeEach void setup() { @@ -48,14 +48,14 @@ class IncludExcludeEndpointFilterTests { @Test void createWhenEndpointTypeIsNullShouldThrowException() { assertThatIllegalArgumentException() - .isThrownBy(() -> new IncludExcludeEndpointFilter<>(null, new MockEnvironment(), "foo")) + .isThrownBy(() -> new IncludeExcludeEndpointFilter<>(null, new MockEnvironment(), "foo")) .withMessageContaining("EndpointType must not be null"); } @Test void createWhenEnvironmentIsNullShouldThrowException() { assertThatIllegalArgumentException() - .isThrownBy(() -> new IncludExcludeEndpointFilter<>(ExposableEndpoint.class, null, "foo")) + .isThrownBy(() -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, null, "foo")) .withMessageContaining("Environment must not be null"); } @@ -63,14 +63,15 @@ class IncludExcludeEndpointFilterTests { void createWhenPrefixIsNullShouldThrowException() { assertThatIllegalArgumentException() .isThrownBy( - () -> new IncludExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), null)) + () -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), null)) .withMessageContaining("Prefix must not be empty"); } @Test void createWhenPrefixIsEmptyShouldThrowException() { assertThatIllegalArgumentException() - .isThrownBy(() -> new IncludExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), "")) + .isThrownBy( + () -> new IncludeExcludeEndpointFilter<>(ExposableEndpoint.class, new MockEnvironment(), "")) .withMessageContaining("Prefix must not be empty"); } @@ -121,7 +122,7 @@ class IncludExcludeEndpointFilterTests { MockEnvironment environment = new MockEnvironment(); environment.setProperty("foo.include", "bar"); environment.setProperty("foo.exclude", ""); - this.filter = new IncludExcludeEndpointFilter<>(DifferentTestExposableWebEndpoint.class, environment, "foo"); + this.filter = new IncludeExcludeEndpointFilter<>(DifferentTestExposableWebEndpoint.class, environment, "foo"); assertThat(match(EndpointId.of("baz"))).isTrue(); } @@ -157,7 +158,7 @@ class IncludExcludeEndpointFilterTests { MockEnvironment environment = new MockEnvironment(); environment.setProperty("foo.include", include); environment.setProperty("foo.exclude", exclude); - this.filter = new IncludExcludeEndpointFilter<>(TestExposableWebEndpoint.class, environment, "foo", "def"); + this.filter = new IncludeExcludeEndpointFilter<>(TestExposableWebEndpoint.class, environment, "foo", "def"); } @SuppressWarnings({ "rawtypes", "unchecked" }) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java index 941a7881930..b3b5c37f546 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java @@ -24,7 +24,7 @@ import java.util.stream.Collectors; import org.junit.jupiter.api.Test; import org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration; -import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter; +import org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludeExcludeEndpointFilter; import org.springframework.boot.actuate.endpoint.EndpointId; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; import org.springframework.boot.actuate.endpoint.http.ActuatorMediaType; @@ -104,7 +104,7 @@ class WebEndpointAutoConfigurationTests { @Test void webApplicationConfiguresExposeExcludePropertyEndpointFilter() { this.contextRunner - .run((context) -> assertThat(context).getBeans(IncludExcludeEndpointFilter.class).containsKeys( + .run((context) -> assertThat(context).getBeans(IncludeExcludeEndpointFilter.class).containsKeys( "webExposeExcludePropertyEndpointFilter", "controllerExposeExcludePropertyEndpointFilter")); }