From f64042b337ccd7e63a4c6aa9923579c73af1bf24 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 11 Dec 2025 14:56:40 +0000 Subject: [PATCH] Remove duplicate @Configuration from test config class hierarchies Closes gh-48498 --- ...stractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java | 2 -- .../AbstractSpringBootTestWebServerWebEnvironmentTests.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java index 4168419d512..7f9db5fa47e 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests.java @@ -30,7 +30,6 @@ import org.springframework.boot.web.reactive.context.ReactiveWebApplicationConte import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.http.server.reactive.HttpHandler; import org.springframework.test.web.reactive.server.WebTestClient; @@ -96,7 +95,6 @@ abstract class AbstractSpringBootTestEmbeddedReactiveWebEnvironmentTests { assertThat(this.value).isEqualTo(123); } - @Configuration(proxyBeanMethods = false) static class AbstractConfig { @Value("${server.port:8080}") diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java index 7d3a23f4ca7..ef3144fc825 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/AbstractSpringBootTestWebServerWebEnvironmentTests.java @@ -26,7 +26,6 @@ import org.springframework.boot.test.web.server.LocalServerPort; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.servlet.server.ServletWebServerFactory; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.client.RestTemplate; @@ -91,7 +90,6 @@ abstract class AbstractSpringBootTestWebServerWebEnvironmentTests { assertThat(this.context).isSameAs(WebApplicationContextUtils.getWebApplicationContext(this.servletContext)); } - @Configuration(proxyBeanMethods = false) static class AbstractConfig { @Value("${server.port:8080}")