22
22
import org .apache .commons .logging .Log ;
23
23
import org .apache .commons .logging .LogFactory ;
24
24
25
+ import org .springframework .beans .BeanUtils ;
25
26
import org .springframework .core .annotation .AnnotatedElementUtils ;
26
27
import org .springframework .core .annotation .AnnotationUtils ;
27
- import org .springframework .util .Assert ;
28
28
import org .springframework .util .ClassUtils ;
29
29
import org .springframework .util .MultiValueMap ;
30
30
31
- import static org .springframework .beans .BeanUtils .instantiateClass ;
32
-
33
31
/**
34
32
* {@code BootstrapUtils} is a collection of utility methods to assist with
35
33
* bootstrapping the <em>Spring TestContext Framework</em>.
@@ -80,7 +78,7 @@ static BootstrapContext createBootstrapContext(Class<?> testClass) {
80
78
if (logger .isDebugEnabled ()) {
81
79
logger .debug (String .format ("Instantiating BootstrapContext using constructor [%s]" , constructor ));
82
80
}
83
- return instantiateClass (constructor , testClass , cacheAwareContextLoaderDelegate );
81
+ return BeanUtils . instantiateClass (constructor , testClass , cacheAwareContextLoaderDelegate );
84
82
}
85
83
catch (Throwable ex ) {
86
84
throw new IllegalStateException ("Could not load BootstrapContext [" + clazz + "]" , ex );
@@ -98,7 +96,7 @@ private static CacheAwareContextLoaderDelegate createCacheAwareContextLoaderDele
98
96
logger .debug (String .format ("Instantiating CacheAwareContextLoaderDelegate from class [%s]" ,
99
97
clazz .getName ()));
100
98
}
101
- return instantiateClass (clazz , CacheAwareContextLoaderDelegate .class );
99
+ return BeanUtils . instantiateClass (clazz , CacheAwareContextLoaderDelegate .class );
102
100
}
103
101
catch (Throwable ex ) {
104
102
throw new IllegalStateException ("Could not load CacheAwareContextLoaderDelegate [" + clazz + "]" , ex );
@@ -134,7 +132,8 @@ static TestContextBootstrapper resolveTestContextBootstrapper(BootstrapContext b
134
132
logger .debug (String .format ("Instantiating TestContextBootstrapper for test class [%s] from class [%s]" ,
135
133
testClass .getName (), clazz .getName ()));
136
134
}
137
- TestContextBootstrapper testContextBootstrapper = instantiateClass (clazz , TestContextBootstrapper .class );
135
+ TestContextBootstrapper testContextBootstrapper =
136
+ BeanUtils .instantiateClass (clazz , TestContextBootstrapper .class );
138
137
testContextBootstrapper .setBootstrapContext (bootstrapContext );
139
138
return testContextBootstrapper ;
140
139
}
0 commit comments