use of org.springframework.test.context.BootstrapContext in project spring-boot by spring-projects.
the class SpringBootTestContextBootstrapperTests method buildTestContext.
@SuppressWarnings("rawtypes")
private void buildTestContext(Class<?> testClass) {
SpringBootTestContextBootstrapper bootstrapper = new SpringBootTestContextBootstrapper();
BootstrapContext bootstrapContext = mock(BootstrapContext.class);
bootstrapper.setBootstrapContext(bootstrapContext);
given((Class) bootstrapContext.getTestClass()).willReturn(testClass);
CacheAwareContextLoaderDelegate contextLoaderDelegate = mock(CacheAwareContextLoaderDelegate.class);
given(bootstrapContext.getCacheAwareContextLoaderDelegate()).willReturn(contextLoaderDelegate);
bootstrapper.buildTestContext();
}
use of org.springframework.test.context.BootstrapContext in project spring-framework by spring-projects.
the class AbstractContextConfigurationUtilsTests method buildMergedContextConfiguration.
MergedContextConfiguration buildMergedContextConfiguration(Class<?> testClass) {
CacheAwareContextLoaderDelegate cacheAwareContextLoaderDelegate = Mockito.mock(CacheAwareContextLoaderDelegate.class);
BootstrapContext bootstrapContext = BootstrapTestUtils.buildBootstrapContext(testClass, cacheAwareContextLoaderDelegate);
TestContextBootstrapper bootstrapper = BootstrapTestUtils.resolveTestContextBootstrapper(bootstrapContext);
return bootstrapper.buildMergedContextConfiguration();
}
Aggregations