@ -277,7 +277,7 @@ public abstract class AbstractTestContextBootstrapper implements TestContextBoot
}
}
MergedContextConfiguration mergedConfig = buildMergedContextConfiguration (
MergedContextConfiguration mergedConfig = buildMergedContextConfiguration (
testClass , defaultConfigAttributesList , contextLoader , null , cacheAwareContextLoaderDelegate , false ) ;
testClass , defaultConfigAttributesList , contextLoader , null , cacheAwareContextLoaderDelegate , false ) ;
logWarningForIgnoredDefaultConfig ( mergedConfig , contextLoader , c acheAwareContextLoaderDelegate ) ;
logWarningForIgnoredDefaultConfig ( mergedConfig , cacheAwareContextLoaderDelegate ) ;
return mergedConfig ;
return mergedConfig ;
}
}
@ -288,12 +288,20 @@ public abstract class AbstractTestContextBootstrapper implements TestContextBoot
* being ignored .
* being ignored .
* /
* /
private void logWarningForIgnoredDefaultConfig ( MergedContextConfiguration mergedConfig ,
private void logWarningForIgnoredDefaultConfig ( MergedContextConfiguration mergedConfig ,
ContextLoader contextLoader , C acheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate ) {
CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate ) {
if ( logger . isWarnEnabled ( ) ) {
if ( logger . isWarnEnabled ( ) ) {
Class < ? > testClass = mergedConfig . getTestClass ( ) ;
Class < ? > testClass = mergedConfig . getTestClass ( ) ;
List < ContextConfigurationAttributes > completeDefaultConfigAttributesList =
List < ContextConfigurationAttributes > completeDefaultConfigAttributesList =
ContextLoaderUtils . resolveDefaultContextConfigurationAttributes ( testClass ) ;
ContextLoaderUtils . resolveDefaultContextConfigurationAttributes ( testClass ) ;
// Ideally, we should be able to reuse the ContextLoader that was resolved
// in buildDefaultMergedContextConfiguration(); however, since we have been
// informed that some implementations of resolveContextLoader() mutate the
// state of the supplied ContextConfigurationAttributes to detect default
// configuration classes, we need to invoke resolveContextLoader() on the
// completeDefaultConfigAttributesList as well in order not to break such
// custom TestContextBootstrappers.
ContextLoader contextLoader = resolveContextLoader ( testClass , completeDefaultConfigAttributesList ) ;
MergedContextConfiguration completeMergedConfig = buildMergedContextConfiguration (
MergedContextConfiguration completeMergedConfig = buildMergedContextConfiguration (
testClass , completeDefaultConfigAttributesList , contextLoader , null ,
testClass , completeDefaultConfigAttributesList , contextLoader , null ,
cacheAwareContextLoaderDelegate , false ) ;
cacheAwareContextLoaderDelegate , false ) ;