Class TestContextAotGenerator
java.lang.Object
org.springframework.test.context.aot.TestContextAotGenerator
TestContextAotGenerator
generates AOT artifacts for integration tests
that depend on support from the Spring TestContext Framework.- Since:
- 6.0
- Author:
- Sam Brannen
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
JVM system property used to set thefailOnError
flag: "spring.test.aot.processing.failOnError". -
Constructor Summary
ConstructorDescriptionTestContextAotGenerator
(GeneratedFiles generatedFiles) Create a newTestContextAotGenerator
that uses the suppliedGeneratedFiles
.TestContextAotGenerator
(GeneratedFiles generatedFiles, RuntimeHints runtimeHints) TestContextAotGenerator
(GeneratedFiles generatedFiles, RuntimeHints runtimeHints, boolean failOnError) Create a newTestContextAotGenerator
that uses the suppliedGeneratedFiles
,RuntimeHints
, andfailOnError
flag. -
Method Summary
Modifier and TypeMethodDescriptionfinal RuntimeHints
Get theRuntimeHints
gathered during AOT processing.void
processAheadOfTime
(Stream<Class<?>> testClasses) Process each of the supplied Spring integration test classes and generate AOT artifacts.
-
Field Details
-
FAIL_ON_ERROR_PROPERTY_NAME
JVM system property used to set thefailOnError
flag: "spring.test.aot.processing.failOnError".The
failOnError
flag controls whether errors encountered during AOT processing in the Spring TestContext Framework should result in an exception that fails the overall process.Defaults to
true
.Supported values include
true
orfalse
, ignoring case. For example, the default may be changed tofalse
by supplying the following JVM system property via the command line.-Dspring.test.aot.processing.failOnError=false
May alternatively be configured via the
SpringProperties
mechanism.- Since:
- 6.1
- See Also:
-
-
Constructor Details
-
TestContextAotGenerator
Create a newTestContextAotGenerator
that uses the suppliedGeneratedFiles
.- Parameters:
generatedFiles
- theGeneratedFiles
to use- See Also:
-
TestContextAotGenerator
Create a newTestContextAotGenerator
that uses the suppliedGeneratedFiles
andRuntimeHints
.This constructor looks up the value of the
failOnError
flag via the "spring.test.aot.processing.failOnError" property, defaulting totrue
if the property is not set.- Parameters:
generatedFiles
- theGeneratedFiles
to useruntimeHints
- theRuntimeHints
to use- See Also:
-
TestContextAotGenerator
public TestContextAotGenerator(GeneratedFiles generatedFiles, RuntimeHints runtimeHints, boolean failOnError) Create a newTestContextAotGenerator
that uses the suppliedGeneratedFiles
,RuntimeHints
, andfailOnError
flag.- Parameters:
generatedFiles
- theGeneratedFiles
to useruntimeHints
- theRuntimeHints
to usefailOnError
-true
if errors encountered during AOT processing should result in an exception that fails the overall process- Since:
- 6.1
-
-
Method Details
-
getRuntimeHints
Get theRuntimeHints
gathered during AOT processing. -
processAheadOfTime
Process each of the supplied Spring integration test classes and generate AOT artifacts.- Throws:
TestContextAotException
- if an error occurs during AOT processing
-