Interface TestRuntimeHintsRegistrar
public interface TestRuntimeHintsRegistrar
Contract for registering
RuntimeHints
for integration tests run with
the Spring TestContext Framework based on the ClassLoader
of the deployment unit. Implementations should, if possible, use the specified
ClassLoader
to determine if hints have to be contributed.
Implementations of this interface must be registered statically in
META-INF/spring/aot.factories
by using the fully qualified name of this
interface as the key. A standard no-arg constructor is required for implementations.
This API serves as a companion to the core
RuntimeHintsRegistrar
API. If you need to register global hints for testing support that are not
specific to particular test classes, favor implementing RuntimeHintsRegistrar
over this API.
As an alternative to implementing and registering a TestRuntimeHintsRegistrar
,
you may choose to annotate a test class with
@Reflective
,
@RegisterReflectionForBinding
,
or @ImportRuntimeHints
.
- Since:
- 6.0
- Author:
- Sam Brannen
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
registerHints
(RuntimeHints runtimeHints, Class<?> testClass, ClassLoader classLoader) Contribute hints to the givenRuntimeHints
instance.
-
Method Details
-
registerHints
Contribute hints to the givenRuntimeHints
instance.- Parameters:
runtimeHints
- theRuntimeHints
to usetestClass
- the test class to processclassLoader
- the classloader to use
-