Polishing
This commit is contained in:
parent
d81ddcef34
commit
02d3269dbb
|
|
@ -137,8 +137,8 @@ public class PropertySourceProcessor {
|
|||
propertySources.addLast(propertySource);
|
||||
}
|
||||
else {
|
||||
String firstProcessed = this.propertySourceNames.get(this.propertySourceNames.size() - 1);
|
||||
propertySources.addBefore(firstProcessed, propertySource);
|
||||
String lastAdded = this.propertySourceNames.get(this.propertySourceNames.size() - 1);
|
||||
propertySources.addBefore(lastAdded, propertySource);
|
||||
}
|
||||
this.propertySourceNames.add(name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue