From 65daea1e2a8cf32ced9a41664cc099a17922e847 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Mon, 27 Oct 2025 12:18:36 +0100 Subject: [PATCH] Polish tests for the SpringExtension --- ...tiveProfilesTestClassScopedExtensionContextNestedTests.java | 1 - ...onfigurationTestClassScopedExtensionContextNestedTests.java | 2 +- .../jupiter/nested/TestExecutionListenersNestedTests.java | 1 - ...opertySourceTestClassScopedExtensionContextNestedTests.java | 3 +-- .../junit/jupiter/nested/WebAppConfigurationNestedTests.java | 3 +-- 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/ActiveProfilesTestClassScopedExtensionContextNestedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/ActiveProfilesTestClassScopedExtensionContextNestedTests.java index 1a80d5a8f3c..ce83b45a1f5 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/ActiveProfilesTestClassScopedExtensionContextNestedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/ActiveProfilesTestClassScopedExtensionContextNestedTests.java @@ -158,7 +158,6 @@ class ActiveProfilesTestClassScopedExtensionContextNestedTests { } } } - } // ------------------------------------------------------------------------- diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/ContextConfigurationTestClassScopedExtensionContextNestedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/ContextConfigurationTestClassScopedExtensionContextNestedTests.java index 6ee181fe100..34bbcc3bec6 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/ContextConfigurationTestClassScopedExtensionContextNestedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/ContextConfigurationTestClassScopedExtensionContextNestedTests.java @@ -88,7 +88,7 @@ class ContextConfigurationTestClassScopedExtensionContextNestedTests { @Nested @NestedTestConfiguration(INHERIT) - class NestedTestCaseWithInheritedConfigTests { + class NestedWithInheritedConfigTests { @Autowired(required = false) @Qualifier("foo") diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/TestExecutionListenersNestedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/TestExecutionListenersNestedTests.java index 0fa1d0b3c63..fd3111216c9 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/TestExecutionListenersNestedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/TestExecutionListenersNestedTests.java @@ -134,7 +134,6 @@ class TestExecutionListenersNestedTests { } } } - } // ------------------------------------------------------------------------- diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/TestPropertySourceTestClassScopedExtensionContextNestedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/TestPropertySourceTestClassScopedExtensionContextNestedTests.java index 369d1734175..6f1744da48f 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/TestPropertySourceTestClassScopedExtensionContextNestedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/TestPropertySourceTestClassScopedExtensionContextNestedTests.java @@ -27,7 +27,6 @@ import org.springframework.test.context.NestedTestConfiguration; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import org.springframework.test.context.junit.jupiter.nested.TestPropertySourceTestClassScopedExtensionContextNestedTests.Config; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.context.NestedTestConfiguration.EnclosingConfiguration.INHERIT; @@ -42,7 +41,7 @@ import static org.springframework.test.context.NestedTestConfiguration.Enclosing * @author Sam Brannen * @since 5.3 */ -@SpringJUnitConfig(Config.class) +@SpringJUnitConfig @TestPropertySource(properties = "p1 = v1") @NestedTestConfiguration(OVERRIDE) // since INHERIT is now the global default class TestPropertySourceTestClassScopedExtensionContextNestedTests { diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/WebAppConfigurationNestedTests.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/WebAppConfigurationNestedTests.java index c8ab547ee98..c75e14e5c85 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/WebAppConfigurationNestedTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/nested/WebAppConfigurationNestedTests.java @@ -24,7 +24,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.test.context.NestedTestConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import org.springframework.test.context.junit.jupiter.nested.WebAppConfigurationNestedTests.Config; import org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.web.context.WebApplicationContext; @@ -44,7 +43,7 @@ import static org.springframework.test.context.NestedTestConfiguration.Enclosing * @see ConstructorInjectionTestMethodScopedExtensionContextNestedTests * @see org.springframework.test.context.junit4.nested.NestedTestsWithSpringRulesTests */ -@SpringJUnitWebConfig(Config.class) +@SpringJUnitWebConfig @NestedTestConfiguration(OVERRIDE) // since INHERIT is now the global default class WebAppConfigurationNestedTests {