Register hints for @TestPropertySource factory
This commit updates MergedContextConfigurationRuntimeHints so that it registers hints for a custom PropertySourceFactory. Closes gh-31160
This commit is contained in:
@@ -76,6 +76,12 @@ class MergedContextConfigurationRuntimeHints {
|
||||
for (PropertySourceDescriptor descriptor : mergedConfig.getPropertySourceDescriptors()) {
|
||||
// @TestPropertySource(locations = ...)
|
||||
registerClasspathResources(descriptor.locations().stream(), runtimeHints, classLoader);
|
||||
|
||||
// @TestPropertySource(factory = ...)
|
||||
Class<?> factoryClass = descriptor.propertySourceFactory();
|
||||
if (factoryClass != null) {
|
||||
registerDeclaredConstructors(factoryClass, runtimeHints);
|
||||
}
|
||||
}
|
||||
|
||||
// @WebAppConfiguration(value = ...)
|
||||
|
||||
Reference in New Issue
Block a user