From 52712cecce3b1ca71c64fabe65f1a6742580e6b7 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 2 Sep 2022 13:15:32 +0200 Subject: [PATCH] Document reasons for hint registration in the TestContext framework --- .../test/context/aot/hint/TestContextRuntimeHints.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-test/src/main/java/org/springframework/test/context/aot/hint/TestContextRuntimeHints.java b/spring-test/src/main/java/org/springframework/test/context/aot/hint/TestContextRuntimeHints.java index 391f30cbc80..31ac2734640 100644 --- a/spring-test/src/main/java/org/springframework/test/context/aot/hint/TestContextRuntimeHints.java +++ b/spring-test/src/main/java/org/springframework/test/context/aot/hint/TestContextRuntimeHints.java @@ -45,36 +45,45 @@ class TestContextRuntimeHints implements RuntimeHintsRegistrar { ReflectionHints reflectionHints = runtimeHints.reflection(); registerPublicConstructors(reflectionHints, + // Loaded reflectively in BootstrapUtils org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.class, + // Loaded reflectively in BootstrapUtils org.springframework.test.context.support.DefaultBootstrapContext.class, + // Loaded reflectively in AbstractTestContextBootstrapper#resolveContextLoader() org.springframework.test.context.support.DelegatingSmartContextLoader.class ); registerDeclaredConstructors(reflectionHints, + // Loaded reflectively in BootstrapUtils org.springframework.test.context.support.DefaultTestContextBootstrapper.class ); if (servletPresent) { registerPublicConstructors(reflectionHints, + // Loaded reflectively in AbstractTestContextBootstrapper#resolveContextLoader() "org.springframework.test.context.web.WebDelegatingSmartContextLoader" ); registerDeclaredConstructors(reflectionHints, + // Loaded reflectively in BootstrapUtils "org.springframework.test.context.web.WebTestContextBootstrapper" ); } if (groovyPresent) { registerDeclaredConstructors(reflectionHints, + // Loaded reflectively in DelegatingSmartContextLoader "org.springframework.test.context.support.GenericGroovyXmlContextLoader" ); if (servletPresent) { registerDeclaredConstructors(reflectionHints, + // Loaded reflectively in WebDelegatingSmartContextLoader "org.springframework.test.context.web.GenericGroovyXmlWebContextLoader" ); } } registerAnnotation(runtimeHints.reflection(), + // Loaded reflectively in BootstrapUtils org.springframework.test.context.web.WebAppConfiguration.class ); }