From 8ecb659a3519ed031c1ca744de77dff1b2d0fd4d Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 15 Oct 2018 21:00:06 -0700 Subject: [PATCH 1/2] Deprecate SecurityPrerequisite Deprecate `SecurityPrerequisite` interface since we don't support it in Spring Boot 2. Closes gh-14846 --- .../autoconfigure/web/server/ManagementServerProperties.java | 3 +-- .../boot/autoconfigure/security/SecurityPrerequisite.java | 4 +++- .../boot/autoconfigure/security/SecurityProperties.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java index 6ea068e640..295f43ee7f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java @@ -18,7 +18,6 @@ package org.springframework.boot.actuate.autoconfigure.web.server; import java.net.InetAddress; -import org.springframework.boot.autoconfigure.security.SecurityPrerequisite; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.NestedConfigurationProperty; @@ -36,7 +35,7 @@ import org.springframework.util.StringUtils; * @see ServerProperties */ @ConfigurationProperties(prefix = "management.server", ignoreUnknownFields = true) -public class ManagementServerProperties implements SecurityPrerequisite { +public class ManagementServerProperties { /** * Management endpoint HTTP port (uses the same port as the application by default). diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityPrerequisite.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityPrerequisite.java index c6cd5207be..0261041884 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityPrerequisite.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityPrerequisite.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,9 @@ package org.springframework.boot.autoconfigure.security; * configuration is evaluated. * * @author Dave Syer + * @deprecated since 2.0.6 since security prerequisites are not supported in Spring Boot 2 */ +@Deprecated public interface SecurityPrerequisite { } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java index a639b3b272..058459b652 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityProperties.java @@ -37,7 +37,7 @@ import org.springframework.util.StringUtils; * @author Madhura Bhave */ @ConfigurationProperties(prefix = "spring.security") -public class SecurityProperties implements SecurityPrerequisite { +public class SecurityProperties { /** * Order applied to the WebSecurityConfigurerAdapter that is used to configure basic From a12a6f2ade51e82785f221b1c7ee4d8ce97b188c Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 15 Oct 2018 21:24:35 -0700 Subject: [PATCH 2/2] Polish --- .../boot/actuate/endpoint/EndpointIdTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java index e80876f368..f496ff854f 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java @@ -99,8 +99,8 @@ public class EndpointIdTests { EndpointId five = EndpointId.of("barfoo1"); EndpointId six = EndpointId.of("foobar2"); assertThat(one.hashCode()).isEqualTo(two.hashCode()); - assertThat(one).isEqualTo(one).isEqualTo(two).isEqualTo(two).isEqualTo(three) - .isEqualTo(four).isNotEqualTo(five).isNotEqualTo(six); + assertThat(one).isEqualTo(one).isEqualTo(two).isEqualTo(three).isEqualTo(four) + .isNotEqualTo(five).isNotEqualTo(six); } @Test