Home / Function/ loadWhenEnvironmentPrefixSetShouldBind() — spring-boot Function Reference

loadWhenEnvironmentPrefixSetShouldBind() — spring-boot Function Reference

Architecture documentation for the loadWhenEnvironmentPrefixSetShouldBind() function in ConfigurationPropertiesTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  a4456466_37ef_8bc8_2f5c_24bb5cdba70f["loadWhenEnvironmentPrefixSetShouldBind()"]
  16b51c89_dde4_bfa7_4c6d_cd813dd33ba3["SpringApplication()"]
  a4456466_37ef_8bc8_2f5c_24bb5cdba70f -->|calls| 16b51c89_dde4_bfa7_4c6d_cd813dd33ba3
  b3ff08aa_f6b7_98d7_10d6_70120d46fa03["setApplicationContextFactory()"]
  a4456466_37ef_8bc8_2f5c_24bb5cdba70f -->|calls| b3ff08aa_f6b7_98d7_10d6_70120d46fa03
  2b0f86f3_6ad1_9ee6_9a1e_b19431054c30["setEnvironmentPrefix()"]
  a4456466_37ef_8bc8_2f5c_24bb5cdba70f -->|calls| 2b0f86f3_6ad1_9ee6_9a1e_b19431054c30
  bcb16b39_1cc9_8ad7_8ae2_fb817a35bf45["setEnvironment()"]
  a4456466_37ef_8bc8_2f5c_24bb5cdba70f -->|calls| bcb16b39_1cc9_8ad7_8ae2_fb817a35bf45
  f5ecfeee_2faa_bfff_05c7_ad8e17034d42["run()"]
  a4456466_37ef_8bc8_2f5c_24bb5cdba70f -->|calls| f5ecfeee_2faa_bfff_05c7_ad8e17034d42
  style a4456466_37ef_8bc8_2f5c_24bb5cdba70f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java lines 517–530

	@Test
	void loadWhenEnvironmentPrefixSetShouldBind() {
		MutablePropertySources sources = this.context.getEnvironment().getPropertySources();
		sources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
				new SystemEnvironmentPropertySource(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
						Collections.singletonMap("MY_SPRING_FOO_NAME", "Jane")));
		SpringApplication application = new SpringApplication(PrefixConfiguration.class);
		application.setApplicationContextFactory((webApplicationType) -> ConfigurationPropertiesTests.this.context);
		application.setEnvironmentPrefix("my");
		application.setEnvironment(this.context.getEnvironment());
		application.run();
		BasicProperties bean = this.context.getBean(BasicProperties.class);
		assertThat(bean.name).isEqualTo("Jane");
	}

Domain

Subdomains

Frequently Asked Questions

What does loadWhenEnvironmentPrefixSetShouldBind() do?
loadWhenEnvironmentPrefixSetShouldBind() is a function in the spring-boot codebase.
What does loadWhenEnvironmentPrefixSetShouldBind() call?
loadWhenEnvironmentPrefixSetShouldBind() calls 5 function(s): SpringApplication, run, setApplicationContextFactory, setEnvironment, setEnvironmentPrefix.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free