use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class AutoConfigurationImportSelectorTests method setup.
@BeforeEach
void setup() {
this.importSelector.setBeanFactory(this.beanFactory);
this.importSelector.setEnvironment(this.environment);
this.importSelector.setResourceLoader(new DefaultResourceLoader());
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class ImportAutoConfigurationImportSelectorTests method setup.
@BeforeEach
void setup() {
this.importSelector.setBeanFactory(this.beanFactory);
this.importSelector.setEnvironment(this.environment);
this.importSelector.setResourceLoader(new DefaultResourceLoader());
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class SpringApplicationTests method customResourceLoaderFromConstructor.
@Test
void customResourceLoaderFromConstructor() {
ResourceLoader resourceLoader = new DefaultResourceLoader();
TestSpringApplication application = new TestSpringApplication(resourceLoader, ExampleWebConfig.class);
this.context = application.run();
then(application.getLoader()).should().setResourceLoader(resourceLoader);
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class SpringApplicationTests method customResourceLoader.
@Test
void customResourceLoader() {
TestSpringApplication application = new TestSpringApplication(ExampleConfig.class);
application.setWebApplicationType(WebApplicationType.NONE);
ResourceLoader resourceLoader = new DefaultResourceLoader();
application.setResourceLoader(resourceLoader);
this.context = application.run();
then(application.getLoader()).should().setResourceLoader(resourceLoader);
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class SpringApplicationBuilderTests method parentContextWithClassLoader.
@Test
void parentContextWithClassLoader() {
SpringApplicationBuilder application = new SpringApplicationBuilder(ChildConfig.class).contextFactory(ApplicationContextFactory.ofContextClass(SpyApplicationContext.class));
ClassLoader classLoader = new URLClassLoader(new URL[0], getClass().getClassLoader());
application.resourceLoader(new DefaultResourceLoader(classLoader));
application.parent(ExampleConfig.class);
this.context = application.run();
assertThat(((SpyApplicationContext) this.context).getResourceLoader().getClassLoader()).isEqualTo(classLoader);
}
Aggregations