FileEncodingApplicationListenerTests Class — spring-boot Architecture
Architecture documentation for the FileEncodingApplicationListenerTests class in FileEncodingApplicationListenerTests.java from the spring-boot codebase.
Entity Profile
Relationship Graph
Source Code
core/spring-boot/src/test/java/org/springframework/boot/context/FileEncodingApplicationListenerTests.java lines 37–68
class FileEncodingApplicationListenerTests {
private final FileEncodingApplicationListener initializer = new FileEncodingApplicationListener();
private final ConfigurableEnvironment environment = new StandardEnvironment();
private final ApplicationEnvironmentPreparedEvent event = new ApplicationEnvironmentPreparedEvent(
new DefaultBootstrapContext(), new SpringApplication(), new String[0], this.environment);
@Test
void testIllegalState() {
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment,
"spring.mandatory_file_encoding=FOO");
ConfigurationPropertySources.attach(this.environment);
assertThatIllegalStateException().isThrownBy(() -> this.initializer.onApplicationEvent(this.event));
}
@Test
void testSunnyDayNothingMandated() {
this.initializer.onApplicationEvent(this.event);
}
@Test
void testSunnyDayMandated() {
assertThat(System.getProperty("file.encoding")).isNotNull();
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment,
"spring.mandatory_file_encoding:" + System.getProperty("file.encoding"));
ConfigurationPropertySources.attach(this.environment);
this.initializer.onApplicationEvent(this.event);
}
}
Domain
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free