diff --git a/spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java b/spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java index f03d9c336a..93efd431cc 100644 --- a/spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java @@ -132,11 +132,12 @@ class AotIntegrationTests extends AbstractAotTests { // // 2) Or you can use the TestClassScanner to find test classes. List> testClasses = createTestClassScanner() - // Scan all packages. - .scan() + // Scan all base packages in spring-test. + .scan("org.springframework.mock", "org.springframework.test") // Or limit execution to a particular package and its subpackages. - // .scan("org.springframework.test.context.junit4") - // Only include test classes named *Tests so that we don't pick up + // - For example, to test @EJB and @PersistenceContext DI support: + // .scan("org.springframework.test.context.testng.transaction.ejb") + // We only include test classes named *Tests so that we don't pick up // internal TestCase classes that aren't really tests. .filter(clazz -> clazz.getSimpleName().endsWith("Tests")) .toList(); diff --git a/spring-test/src/test/java/org/springframework/test/context/env/ExplicitPropertiesFileTestPropertySourceTests.java b/spring-test/src/test/java/org/springframework/test/context/env/ExplicitPropertiesFileTestPropertySourceTests.java index b142718f43..0a47f785f4 100644 --- a/spring-test/src/test/java/org/springframework/test/context/env/ExplicitPropertiesFileTestPropertySourceTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/env/ExplicitPropertiesFileTestPropertySourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2023 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. @@ -58,7 +58,7 @@ class ExplicitPropertiesFileTestPropertySourceTests { @Nested @DisplayName("with absolute path") @TestPropertySource("/org/springframework/test/context/env/explicit.properties") - class AbsolutePathPathTests extends AbstractExplicitPropertiesFileTests { + class AbsolutePathTests extends AbstractExplicitPropertiesFileTests { } @Nested diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java index 14f7d09f71..ef6c647f25 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2023 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. @@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.fail; * @see HardCodedProfileValueSourceSpringRunnerTests */ @RunWith(SpringRunner.class) -@TestExecutionListeners( {}) +@TestExecutionListeners({}) public class EnabledAndIgnoredSpringRunnerTests { protected static final String NAME = "EnabledAndIgnoredSpringRunnerTests.profile_value.name"; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java index 07776e8985..b0d4e267b6 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2023 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. @@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @since 3.0 */ @RunWith(SpringRunner.class) -@TestExecutionListeners( {}) +@TestExecutionListeners({}) public class SpringJUnit47ClassRunnerRuleTests { @Rule diff --git a/spring-test/src/test/java/org/springframework/test/context/junit4/nested/NestedTestsWithSpringRulesTests.java b/spring-test/src/test/java/org/springframework/test/context/junit4/nested/NestedTestsWithSpringRulesTests.java index cf260e2418..654a0edca5 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit4/nested/NestedTestsWithSpringRulesTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit4/nested/NestedTestsWithSpringRulesTests.java @@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Sam Brannen * @since 5.0 - * @see org.springframework.test.context.junit.jupiter.nested.NestedTestsWithSpringAndJUnitJupiterTestCase + * @see org.springframework.test.context.junit.jupiter.nested.ContextConfigurationNestedTests */ @RunWith(HierarchicalContextRunner.class) @ContextConfiguration(classes = TopLevelConfig.class)