Polishing
This commit is contained in:
@@ -126,6 +126,9 @@ class TestPropertySourceAttributes {
|
||||
TestContextResourceUtils.convertToClasspathResourcePaths(declaringClass, true, locations);
|
||||
Class<? extends PropertySourceFactory> factoryClass =
|
||||
(Class<? extends PropertySourceFactory>) mergedAnnotation.getClass("factory");
|
||||
if (factoryClass == PropertySourceFactory.class) {
|
||||
factoryClass = null; // default factory type will be inferred
|
||||
}
|
||||
String encoding = mergedAnnotation.getString("encoding");
|
||||
if (encoding.isBlank()) {
|
||||
encoding = null; // default encoding will be inferred
|
||||
|
||||
@@ -293,8 +293,7 @@ public abstract class TestPropertySourceUtils {
|
||||
for (PropertySourceDescriptor descriptor : descriptors) {
|
||||
if (!descriptor.locations().isEmpty()) {
|
||||
Class<? extends PropertySourceFactory> factoryClass = descriptor.propertySourceFactory();
|
||||
PropertySourceFactory factory =
|
||||
(factoryClass != null && factoryClass != PropertySourceFactory.class ?
|
||||
PropertySourceFactory factory = (factoryClass != null ?
|
||||
BeanUtils.instantiateClass(factoryClass) : defaultPropertySourceFactory);
|
||||
|
||||
for (String location : descriptor.locations()) {
|
||||
|
||||
Reference in New Issue
Block a user