use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class HazelcastClientConfigAvailableConditionTests method getMatchOutcome.
private ConditionOutcome getMatchOutcome(Environment environment) {
ConditionContext conditionContext = mock(ConditionContext.class);
given(conditionContext.getEnvironment()).willReturn(environment);
given(conditionContext.getResourceLoader()).willReturn(new DefaultResourceLoader());
return this.condition.getMatchOutcome(conditionContext, mock(AnnotatedTypeMetadata.class));
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class SpringApplication method printBanner.
private Banner printBanner(ConfigurableEnvironment environment) {
if (this.bannerMode == Banner.Mode.OFF) {
return null;
}
ResourceLoader resourceLoader = (this.resourceLoader != null) ? this.resourceLoader : new DefaultResourceLoader(null);
SpringApplicationBannerPrinter bannerPrinter = new SpringApplicationBannerPrinter(resourceLoader, this.banner);
if (this.bannerMode == Mode.LOG) {
return bannerPrinter.print(environment, this.mainApplicationClass, logger);
}
return bannerPrinter.print(environment, this.mainApplicationClass, System.out);
}
use of org.springframework.core.io.DefaultResourceLoader in project spring-boot by spring-projects.
the class ConfigurationPropertiesScanTests method scanImportBeanRegistrarShouldBeResourceLoaderAwareWithRequiredResource.
@Test
void scanImportBeanRegistrarShouldBeResourceLoaderAwareWithRequiredResource() {
DefaultResourceLoader resourceLoader = mock(DefaultResourceLoader.class);
this.context.setResourceLoader(resourceLoader);
willCallRealMethod().given(resourceLoader).getClassLoader();
given(resourceLoader.getResource("test")).willReturn(new ByteArrayResource("test".getBytes()));
load(TestConfiguration.class);
assertThat(this.context.containsBean("resource-org.springframework.boot.context.properties.scan.valid.a.AScanConfiguration$MyResourceProperties")).isTrue();
}
Aggregations