Search in sources :

Example 1 with SpringBootTestContextBootstrapper

use of org.springframework.boot.test.context.SpringBootTestContextBootstrapper 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();
}
Also used : CacheAwareContextLoaderDelegate(org.springframework.test.context.CacheAwareContextLoaderDelegate) BootstrapContext(org.springframework.test.context.BootstrapContext) SpringBootTestContextBootstrapper(org.springframework.boot.test.context.SpringBootTestContextBootstrapper)

Aggregations

SpringBootTestContextBootstrapper (org.springframework.boot.test.context.SpringBootTestContextBootstrapper)1 BootstrapContext (org.springframework.test.context.BootstrapContext)1 CacheAwareContextLoaderDelegate (org.springframework.test.context.CacheAwareContextLoaderDelegate)1