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 SummaryFieldsModifier and TypeFieldDescriptionstatic final StringJVM system property used to set thefailOnErrorflag: "spring.test.aot.processing.failOnError".
- 
Constructor SummaryConstructorsConstructorDescriptionTestContextAotGenerator(GeneratedFiles generatedFiles) Create a newTestContextAotGeneratorthat uses the suppliedGeneratedFiles.TestContextAotGenerator(GeneratedFiles generatedFiles, RuntimeHints runtimeHints) TestContextAotGenerator(GeneratedFiles generatedFiles, RuntimeHints runtimeHints, boolean failOnError) Create a newTestContextAotGeneratorthat uses the suppliedGeneratedFiles,RuntimeHints, andfailOnErrorflag.
- 
Method SummaryModifier and TypeMethodDescriptionfinal RuntimeHintsGet theRuntimeHintsgathered during AOT processing.voidprocessAheadOfTime(Stream<Class<?>> testClasses) Process each of the supplied Spring integration test classes and generate AOT artifacts.
- 
Field Details- 
FAIL_ON_ERROR_PROPERTY_NAMEJVM system property used to set thefailOnErrorflag: "spring.test.aot.processing.failOnError".The failOnErrorflag 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 trueorfalse, ignoring case. For example, the default may be changed tofalseby supplying the following JVM system property via the command line.-Dspring.test.aot.processing.failOnError=false May alternatively be configured via the SpringPropertiesmechanism.- Since:
- 6.1
- See Also:
 
 
- 
- 
Constructor Details- 
TestContextAotGeneratorCreate a newTestContextAotGeneratorthat uses the suppliedGeneratedFiles.- Parameters:
- generatedFiles- the- GeneratedFilesto use
- See Also:
 
- 
TestContextAotGeneratorCreate a newTestContextAotGeneratorthat uses the suppliedGeneratedFilesandRuntimeHints.This constructor looks up the value of the failOnErrorflag via the "spring.test.aot.processing.failOnError" property, defaulting totrueif the property is not set.- Parameters:
- generatedFiles- the- GeneratedFilesto use
- runtimeHints- the- RuntimeHintsto use
- See Also:
 
- 
TestContextAotGeneratorpublic TestContextAotGenerator(GeneratedFiles generatedFiles, RuntimeHints runtimeHints, boolean failOnError) Create a newTestContextAotGeneratorthat uses the suppliedGeneratedFiles,RuntimeHints, andfailOnErrorflag.- Parameters:
- generatedFiles- the- GeneratedFilesto use
- runtimeHints- the- RuntimeHintsto use
- failOnError-- trueif errors encountered during AOT processing should result in an exception that fails the overall process
- Since:
- 6.1
 
 
- 
- 
Method Details- 
getRuntimeHintsGet theRuntimeHintsgathered during AOT processing.
- 
processAheadOfTimeProcess each of the supplied Spring integration test classes and generate AOT artifacts.- Throws:
- TestContextAotException- if an error occurs during AOT processing
 
 
-