Introduce AotTestAttributes mechanism in the TestContext framework #29100
Labels
in: test
Issues in the test module
theme: aot
An issue related to Ahead-of-time processing
type: enhancement
A general enhancement
Milestone
Overview
For certain use cases it would be beneficial to be able to compute something during AOT build-time processing and then retrieve the result of that computation during AOT run-time execution.
Use Case
The
SpringBootTestContextBootstrapper
performs class path scanning for the@SpringBootConfiguration
class using a utility calledAnnotatedClassFinder
; however, class path scanning does not work within a GraalVM native image.In the Spring Native project, the
AnnotatedClassFinder
worked without modification because Spring's component indexer was used to index annotated components during the build; however, in Spring Framework 6.0 and Spring Boot 3.0 we do not want to rely on the component indexer.Ideally,
SpringBootTestContextBootstrapper
should be able to:AnnotatedClassFinder
during AOT build-time processing.@SpringBootConfiguration
class for later retrieval.@SpringBootConfiguration
class name that was discovered at build time during AOT run-time execution.Proposal
Introduce an
AotTestAttributes
mechanism in the Spring TestContext Framework.org.springframework.core.AttributeAccessor
String
and the value is anString
String
orboolean
CodeBlock
or statement to create the object in the attributes storeThe text was updated successfully, but these errors were encountered: