Polishing

This commit is contained in:
Sam Brannen 2023-10-16 15:56:12 +02:00
parent 41098d52d6
commit fc81cc5cda
5 changed files with 12 additions and 11 deletions

View File

@ -132,11 +132,12 @@ class AotIntegrationTests extends AbstractAotTests {
// //
// 2) Or you can use the TestClassScanner to find test classes. // 2) Or you can use the TestClassScanner to find test classes.
List<Class<?>> testClasses = createTestClassScanner() List<Class<?>> testClasses = createTestClassScanner()
// Scan all packages. // Scan all base packages in spring-test.
.scan() .scan("org.springframework.mock", "org.springframework.test")
// Or limit execution to a particular package and its subpackages. // Or limit execution to a particular package and its subpackages.
// .scan("org.springframework.test.context.junit4") // - For example, to test @EJB and @PersistenceContext DI support:
// Only include test classes named *Tests so that we don't pick up // .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. // internal TestCase classes that aren't really tests.
.filter(clazz -> clazz.getSimpleName().endsWith("Tests")) .filter(clazz -> clazz.getSimpleName().endsWith("Tests"))
.toList(); .toList();

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -58,7 +58,7 @@ class ExplicitPropertiesFileTestPropertySourceTests {
@Nested @Nested
@DisplayName("with absolute path") @DisplayName("with absolute path")
@TestPropertySource("/org/springframework/test/context/env/explicit.properties") @TestPropertySource("/org/springframework/test/context/env/explicit.properties")
class AbsolutePathPathTests extends AbstractExplicitPropertiesFileTests { class AbsolutePathTests extends AbstractExplicitPropertiesFileTests {
} }
@Nested @Nested

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * @see HardCodedProfileValueSourceSpringRunnerTests
*/ */
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@TestExecutionListeners( {}) @TestExecutionListeners({})
public class EnabledAndIgnoredSpringRunnerTests { public class EnabledAndIgnoredSpringRunnerTests {
protected static final String NAME = "EnabledAndIgnoredSpringRunnerTests.profile_value.name"; protected static final String NAME = "EnabledAndIgnoredSpringRunnerTests.profile_value.name";

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * @since 3.0
*/ */
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@TestExecutionListeners( {}) @TestExecutionListeners({})
public class SpringJUnit47ClassRunnerRuleTests { public class SpringJUnit47ClassRunnerRuleTests {
@Rule @Rule

View File

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Sam Brannen * @author Sam Brannen
* @since 5.0 * @since 5.0
* @see org.springframework.test.context.junit.jupiter.nested.NestedTestsWithSpringAndJUnitJupiterTestCase * @see org.springframework.test.context.junit.jupiter.nested.ContextConfigurationNestedTests
*/ */
@RunWith(HierarchicalContextRunner.class) @RunWith(HierarchicalContextRunner.class)
@ContextConfiguration(classes = TopLevelConfig.class) @ContextConfiguration(classes = TopLevelConfig.class)