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
SpringExtension
via@ExtendWith
. - JUnit 4: classes that register the
SpringJUnit4ClassRunner
orSpringRunner
via@RunWith
. - Generic: classes that are annotated with
@ContextConfiguration
or@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
ConstructorDescriptionTestClassScanner
(Set<Path> classpathRoots) Create aTestClassScanner
for the given classpath roots. -
Method Summary
-
Constructor Details
-
TestClassScanner
Create aTestClassScanner
for the given classpath roots.For example, in a Gradle project that only supports Java-based tests, the supplied set would contain a single
Path
representing the absolute path to the project'sbuild/classes/java/test
folder.- Parameters:
classpathRoots
- the classpath roots to scan
-
-
Method Details
-
scan
Scan the configured classpath roots for Spring integration test classes.
-