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

contextRefreshedEventListener() — spring-boot Function Reference

Architecture documentation for the contextRefreshedEventListener() function in SpringApplicationTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  389aedf5_23cd_5dfe_aa12_fffeee5c2f2b["contextRefreshedEventListener()"]
  2617d46d_c367_35a8_17cf_64149ca9953a["addListener()"]
  389aedf5_23cd_5dfe_aa12_fffeee5c2f2b -->|calls| 2617d46d_c367_35a8_17cf_64149ca9953a
  ff7e5b91_a4f4_e0a5_d92b_ae7a506efd07["getApplicationContext()"]
  389aedf5_23cd_5dfe_aa12_fffeee5c2f2b -->|calls| ff7e5b91_a4f4_e0a5_d92b_ae7a506efd07
  b51c2a0a_c091_ca23_6e06_a954e1fee03d["getEnvironment()"]
  389aedf5_23cd_5dfe_aa12_fffeee5c2f2b -->|calls| b51c2a0a_c091_ca23_6e06_a954e1fee03d
  3613e214_49bf_015b_c43f_7f8a1274fb0b["run()"]
  389aedf5_23cd_5dfe_aa12_fffeee5c2f2b -->|calls| 3613e214_49bf_015b_c43f_7f8a1274fb0b
  style 389aedf5_23cd_5dfe_aa12_fffeee5c2f2b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java lines 375–386

	@Test
	void contextRefreshedEventListener() {
		SpringApplication application = new SpringApplication(ExampleConfig.class);
		application.setWebApplicationType(WebApplicationType.NONE);
		AtomicReference<ContextRefreshedEvent> reference = addListener(application, ContextRefreshedEvent.class);
		this.context = application.run("--foo=bar");
		ContextRefreshedEvent event = reference.get();
		assertThat(event).isNotNull();
		assertThat(this.context).isSameAs(event.getApplicationContext());
		// Custom initializers do not switch off the defaults
		assertThat(getEnvironment().getProperty("foo")).isEqualTo("bar");
	}

Domain

Subdomains

Frequently Asked Questions

What does contextRefreshedEventListener() do?
contextRefreshedEventListener() is a function in the spring-boot codebase.
What does contextRefreshedEventListener() call?
contextRefreshedEventListener() calls 4 function(s): addListener, getApplicationContext, getEnvironment, run.

Analyze Your Own Codebase

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

Try Supermodel Free