ConfigDataEnvironmentPostProcessorBootstrapContextIntegrationTests Class — spring-boot Architecture
Architecture documentation for the ConfigDataEnvironmentPostProcessorBootstrapContextIntegrationTests class in ConfigDataEnvironmentPostProcessorBootstrapContextIntegrationTests.java from the spring-boot codebase.
Entity Profile
Relationship Graph
Source Code
core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorBootstrapContextIntegrationTests.java lines 38–81
class ConfigDataEnvironmentPostProcessorBootstrapContextIntegrationTests {
private SpringApplication application;
@BeforeEach
void setup() {
this.application = new SpringApplication(Config.class);
this.application.setWebApplicationType(WebApplicationType.NONE);
}
@Test
@WithResource(name = "imported.properties", content = """
spring.config.import=testbootstrap:test
spring.profiles.active=test
myprop=igotbound
#---
spring.config.activate.on-profile=test
myprofileprop=igotprofilebound
""")
@WithResource(name = "META-INF/spring.factories", content = """
org.springframework.boot.context.config.ConfigDataLoader=\
org.springframework.boot.context.config.TestConfigDataBootstrap.Loader
org.springframework.boot.context.config.ConfigDataLocationResolver=\
org.springframework.boot.context.config.TestConfigDataBootstrap.LocationResolver
""")
void bootstrapsApplicationContext() {
try (ConfigurableApplicationContext context = this.application
.run("--spring.config.import=classpath:imported.properties")) {
LoaderHelper bean = context.getBean(TestConfigDataBootstrap.LoaderHelper.class);
assertThat(bean).isNotNull();
assertThat(bean.getBound()).isEqualTo("igotbound");
assertThat(bean.getProfileBound()).isEqualTo("igotprofilebound");
assertThat(bean.getLocation().getResolverHelper().getLocation())
.isEqualTo(ConfigDataLocation.of("testbootstrap:test"));
}
}
@Configuration
static class Config {
}
}
Domain
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free