mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
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:
+6
@@ -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