From b4a13dddfcc7be0f5e938613d21d3a161767ccac Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Sat, 1 Nov 2025 14:46:23 +0100 Subject: [PATCH] Fix JUnit Jupiter discovery issues on 6.2.x --- .../jdbc/AfterTestClassSqlScriptsTests.java | 1 + ...edConfigurationErrorsIntegrationTests.java | 33 ------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/test/context/jdbc/AfterTestClassSqlScriptsTests.java b/spring-test/src/test/java/org/springframework/test/context/jdbc/AfterTestClassSqlScriptsTests.java index 9ac6a03f63a..e7dedc39fdc 100644 --- a/spring-test/src/test/java/org/springframework/test/context/jdbc/AfterTestClassSqlScriptsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/jdbc/AfterTestClassSqlScriptsTests.java @@ -72,6 +72,7 @@ class AfterTestClassSqlScriptsTests extends AbstractTransactionalTests { } @Nested + @TestMethodOrder(OrderAnnotation.class) @Sql(scripts = "recreate-schema.sql", executionPhase = BEFORE_TEST_CLASS) @Sql(scripts = "drop-schema.sql", executionPhase = AFTER_TEST_CLASS) class NestedAfterTestClassSqlScriptsTests { diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java index da86801a215..7eccabe27de 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/AutowiredConfigurationErrorsIntegrationTests.java @@ -65,11 +65,9 @@ class AutowiredConfigurationErrorsIntegrationTests { @ParameterizedTest @ValueSource(classes = { StaticAutowiredBeforeAllMethod.class, - StaticAutowiredPrivateBeforeAllMethod.class, StaticAutowiredAfterAllMethod.class, AutowiredBeforeEachMethod.class, AutowiredAfterEachMethod.class, - AutowiredPrivateAfterEachMethod.class, AutowiredTestMethod.class, AutowiredRepeatedTestMethod.class, AutowiredParameterizedTestMethod.class @@ -168,21 +166,6 @@ class AutowiredConfigurationErrorsIntegrationTests { } } - @SpringJUnitConfig(Config.class) - @FailingTestCase - static class StaticAutowiredPrivateBeforeAllMethod { - - @Autowired - @BeforeAll - private static void beforeAll(TestInfo testInfo) { - } - - @Test - @DisplayName(DISPLAY_NAME) - void test() { - } - } - @SpringJUnitConfig(Config.class) @TestInstance(PER_CLASS) @FailingTestCase @@ -260,22 +243,6 @@ class AutowiredConfigurationErrorsIntegrationTests { } } - @SpringJUnitConfig(Config.class) - @FailingTestCase - static class AutowiredPrivateAfterEachMethod { - - @Test - @DisplayName(DISPLAY_NAME) - void test() { - } - - @Autowired - @AfterEach - private void afterEach(TestInfo testInfo) { - } - } - - @SpringJUnitConfig(Config.class) @FailingTestCase static class AutowiredTestMethod {