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

parentFirstWithDifferentProfileAndExplicitEnvironment() — spring-boot Function Reference

Architecture documentation for the parentFirstWithDifferentProfileAndExplicitEnvironment() function in SpringApplicationBuilderTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  66982f2a_bb15_aefa_89ce_3b3dd9eed9cc["parentFirstWithDifferentProfileAndExplicitEnvironment()"]
  3dc59be6_081a_34fd_0727_a7b4669b8750["assertThat()"]
  66982f2a_bb15_aefa_89ce_3b3dd9eed9cc -->|calls| 3dc59be6_081a_34fd_0727_a7b4669b8750
  546343f2_f93a_0dc3_7a91_7016e75078f5["getParent()"]
  66982f2a_bb15_aefa_89ce_3b3dd9eed9cc -->|calls| 546343f2_f93a_0dc3_7a91_7016e75078f5
  f5ecfeee_2faa_bfff_05c7_ad8e17034d42["run()"]
  66982f2a_bb15_aefa_89ce_3b3dd9eed9cc -->|calls| f5ecfeee_2faa_bfff_05c7_ad8e17034d42
  style 66982f2a_bb15_aefa_89ce_3b3dd9eed9cc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/builder/SpringApplicationBuilderTests.java lines 262–278

	@Test
	void parentFirstWithDifferentProfileAndExplicitEnvironment() {
		SpringApplicationBuilder application = new SpringApplicationBuilder(ExampleConfig.class)
			.environment(new StandardEnvironment())
			.profiles("node")
			.properties("transport=redis")
			.child(ChildConfig.class)
			.profiles("admin")
			.web(WebApplicationType.NONE);
		this.context = application.run();
		assertThat(this.context.getEnvironment().acceptsProfiles(Profiles.of("node", "admin"))).isTrue();
		// Now they share an Environment explicitly so there's no way to keep the profiles
		// separate
		ApplicationContext parent = this.context.getParent();
		assertThat(parent).isNotNull();
		assertThat(parent.getEnvironment().acceptsProfiles(Profiles.of("admin"))).isTrue();
	}

Domain

Subdomains

Frequently Asked Questions

What does parentFirstWithDifferentProfileAndExplicitEnvironment() do?
parentFirstWithDifferentProfileAndExplicitEnvironment() is a function in the spring-boot codebase.
What does parentFirstWithDifferentProfileAndExplicitEnvironment() call?
parentFirstWithDifferentProfileAndExplicitEnvironment() calls 3 function(s): assertThat, getParent, run.

Analyze Your Own Codebase

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

Try Supermodel Free