Polishing
This commit is contained in:
@@ -137,15 +137,20 @@ public class TestContextAotGenerator {
|
||||
mergedConfigMappings.add(mergedConfig, testClass);
|
||||
collectRuntimeHintsRegistrarClasses(testClass, coreRuntimeHintsRegistrarClasses);
|
||||
reflectiveRuntimeHintsRegistrar.registerRuntimeHints(this.runtimeHints, testClass);
|
||||
this.testRuntimeHintsRegistrars.forEach(registrar ->
|
||||
registrar.registerHints(this.runtimeHints, testClass, classLoader));
|
||||
this.testRuntimeHintsRegistrars.forEach(registrar -> {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Processing RuntimeHints contribution from class [%s]"
|
||||
.formatted(registrar.getClass().getCanonicalName()));
|
||||
}
|
||||
registrar.registerHints(this.runtimeHints, testClass, classLoader);
|
||||
});
|
||||
});
|
||||
|
||||
coreRuntimeHintsRegistrarClasses.stream()
|
||||
.map(BeanUtils::instantiateClass)
|
||||
.forEach(registrar -> {
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Processing RuntimeHints contribution from test class [%s]"
|
||||
logger.trace("Processing RuntimeHints contribution from class [%s]"
|
||||
.formatted(registrar.getClass().getCanonicalName()));
|
||||
}
|
||||
registrar.registerHints(this.runtimeHints, classLoader);
|
||||
|
||||
@@ -34,6 +34,12 @@ import org.springframework.aot.hint.RuntimeHints;
|
||||
* specific to particular test classes, favor implementing {@code RuntimeHintsRegistrar}
|
||||
* over this API.
|
||||
*
|
||||
* <p>As an alternative to implementing and registering a {@code TestRuntimeHintsRegistrar},
|
||||
* you may choose to annotate a test class with
|
||||
* {@link org.springframework.aot.hint.annotation.Reflective @Reflective},
|
||||
* {@link org.springframework.aot.hint.annotation.RegisterReflectionForBinding @RegisterReflectionForBinding},
|
||||
* or {@link org.springframework.context.annotation.ImportRuntimeHints @ImportRuntimeHints}.
|
||||
*
|
||||
* @author Sam Brannen
|
||||
* @since 6.0
|
||||
* @see org.springframework.aot.hint.RuntimeHintsRegistrar
|
||||
|
||||
Reference in New Issue
Block a user