@@ -75,13 +75,13 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
75
75
// SmartContextLoader
76
76
77
77
/**
78
- * For backwards compatibility with the {@link ContextLoader} SPI, the
79
- * default implementation simply delegates to {@link #processLocations(Class, String...)},
80
- * passing it the {@link ContextConfigurationAttributes#getDeclaringClass()
81
- * declaring class} and {@link ContextConfigurationAttributes#getLocations()
78
+ * The default implementation processes locations analogous to
79
+ * {@link #processLocations(Class, String...)}, using the
80
+ * {@link ContextConfigurationAttributes#getDeclaringClass() declaring class}
81
+ * as the test class and the {@link ContextConfigurationAttributes#getLocations()
82
82
* resource locations} retrieved from the supplied
83
- * {@link ContextConfigurationAttributes configuration attributes}. The
84
- * processed locations are then
83
+ * {@link ContextConfigurationAttributes configuration attributes} as the
84
+ * locations to process. The processed locations are then
85
85
* {@link ContextConfigurationAttributes#setLocations(String[]) set} in
86
86
* the supplied configuration attributes.
87
87
* <p>Can be overridden in subclasses — for example, to process
@@ -92,7 +92,7 @@ public abstract class AbstractContextLoader implements SmartContextLoader {
92
92
@ Override
93
93
public void processContextConfiguration (ContextConfigurationAttributes configAttributes ) {
94
94
String [] processedLocations =
95
- processLocations (configAttributes .getDeclaringClass (), configAttributes .getLocations ());
95
+ processLocationsInternal (configAttributes .getDeclaringClass (), configAttributes .getLocations ());
96
96
configAttributes .setLocations (processedLocations );
97
97
}
98
98
@@ -214,6 +214,10 @@ protected void customizeContext(ConfigurableApplicationContext context, MergedCo
214
214
@ Override
215
215
@ SuppressWarnings ("deprecation" )
216
216
public final String [] processLocations (Class <?> clazz , String ... locations ) {
217
+ return processLocationsInternal (clazz , locations );
218
+ }
219
+
220
+ private String [] processLocationsInternal (Class <?> clazz , String ... locations ) {
217
221
return (ObjectUtils .isEmpty (locations ) && isGenerateDefaultLocations ()) ?
218
222
generateDefaultLocations (clazz ) : modifyLocations (clazz , locations );
219
223
}
0 commit comments