Browse Source

Polishing

pull/31445/head
Sam Brannen 11 months ago
parent
commit
fc81cc5cda
  1. 9
      spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java
  2. 4
      spring-test/src/test/java/org/springframework/test/context/env/ExplicitPropertiesFileTestPropertySourceTests.java
  3. 4
      spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java
  4. 4
      spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java
  5. 2
      spring-test/src/test/java/org/springframework/test/context/junit4/nested/NestedTestsWithSpringRulesTests.java

9
spring-test/src/test/java/org/springframework/test/context/aot/AotIntegrationTests.java

@ -132,11 +132,12 @@ class AotIntegrationTests extends AbstractAotTests { @@ -132,11 +132,12 @@ class AotIntegrationTests extends AbstractAotTests {
//
// 2) Or you can use the TestClassScanner to find test classes.
List<Class<?>> 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();

4
spring-test/src/test/java/org/springframework/test/context/env/ExplicitPropertiesFileTestPropertySourceTests.java vendored

@ -1,5 +1,5 @@ @@ -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 { @@ -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

4
spring-test/src/test/java/org/springframework/test/context/junit4/EnabledAndIgnoredSpringRunnerTests.java

@ -1,5 +1,5 @@ @@ -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; @@ -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";

4
spring-test/src/test/java/org/springframework/test/context/junit4/SpringJUnit47ClassRunnerRuleTests.java

@ -1,5 +1,5 @@ @@ -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; @@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @since 3.0
*/
@RunWith(SpringRunner.class)
@TestExecutionListeners( {})
@TestExecutionListeners({})
public class SpringJUnit47ClassRunnerRuleTests {
@Rule

2
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; @@ -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)

Loading…
Cancel
Save