Register runtime hints for TestContext framework classes and annotations

This commit introduces TestContextRuntimeHints which is a
RuntimeHintsRegistrar implementation that makes core types and
annotations from the Spring TestContext Framework available at runtime
within a GraalVM native image.

TestContextRuntimeHints is registered automatically via the
"META-INF/spring/aot.factories" file in spring-test.

This commit also modifies TestContextAotGeneratorTests to assert the
expected runtime hints registered by TestContextRuntimeHints as well as
runtime hints for TestExecutionListener and ContextCustomizerFactory
implementations registered by SpringFactoriesLoaderRuntimeHints.

Closes gh-29028
Closes gh-29044
This commit is contained in:
Sam Brannen
2022-08-30 15:27:19 +02:00
parent 8a7e839ad0
commit 741ee960e2
3 changed files with 270 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
org.springframework.aot.hint.RuntimeHintsRegistrar=\
org.springframework.test.context.aot.TestContextRuntimeHints