Class TestClassScanner
java.lang.Object
org.springframework.test.context.aot.TestClassScanner
TestClassScanner scans provided classpath roots for Spring integration
test classes using the JUnit Platform Launcher API which allows all
registered TestEngines to discover
tests according to their own rules.
The scanner currently detects the following categories of Spring integration test classes.
- JUnit Jupiter: classes that register the
SpringExtensionvia@ExtendWith. - JUnit 4: classes that register the
SpringJUnit4ClassRunnerorSpringRunnervia@RunWith. - Generic: classes that are annotated with
@ContextConfigurationor@BootstrapWith.
The scanner has been tested with the following
TestEngines.
- JUnit Jupiter
- JUnit Vintage
- JUnit Platform Suite Engine
- TestNG Engine for the JUnit Platform
- Since:
- 6.0
- Author:
- Sam Brannen
-
Constructor Summary
ConstructorsConstructorDescriptionTestClassScanner(Set<Path> classpathRoots) Create aTestClassScannerfor the given classpath roots. -
Method Summary
-
Constructor Details
-
TestClassScanner
Create aTestClassScannerfor the given classpath roots.For example, in a Gradle project that only supports Java-based tests, the supplied set would contain a single
Pathrepresenting the absolute path to the project'sbuild/classes/java/testfolder.- Parameters:
classpathRoots- the classpath roots to scan
-
-
Method Details
-
scan
Scan the configured classpath roots for Spring integration test classes.
-