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

addBootstrapRegistryInitializerCanRegisterBeans() — spring-boot Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  a19a410e_ff31_eb14_7886_265ea3d9f4f4["addBootstrapRegistryInitializerCanRegisterBeans()"]
  8870f075_4e6a_05b7_4a8d_edaa3cf62be9["addBootstrapRegistryInitializer()"]
  a19a410e_ff31_eb14_7886_265ea3d9f4f4 -->|calls| 8870f075_4e6a_05b7_4a8d_edaa3cf62be9
  ff7e5b91_a4f4_e0a5_d92b_ae7a506efd07["getApplicationContext()"]
  a19a410e_ff31_eb14_7886_265ea3d9f4f4 -->|calls| ff7e5b91_a4f4_e0a5_d92b_ae7a506efd07
  d864f877_86bb_ed36_1f8e_bead3d2673be["getBootstrapContext()"]
  a19a410e_ff31_eb14_7886_265ea3d9f4f4 -->|calls| d864f877_86bb_ed36_1f8e_bead3d2673be
  3613e214_49bf_015b_c43f_7f8a1274fb0b["run()"]
  a19a410e_ff31_eb14_7886_265ea3d9f4f4 -->|calls| 3613e214_49bf_015b_c43f_7f8a1274fb0b
  style a19a410e_ff31_eb14_7886_265ea3d9f4f4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java lines 1271–1285

	@Test
	void addBootstrapRegistryInitializerCanRegisterBeans() {
		SpringApplication application = new SpringApplication(ExampleConfig.class);
		application.setWebApplicationType(WebApplicationType.NONE);
		application.addBootstrapRegistryInitializer((bootstrapContext) -> {
			bootstrapContext.register(String.class, InstanceSupplier.of("boot"));
			bootstrapContext.addCloseListener((event) -> {
				String string = event.getBootstrapContext().get(String.class);
				assertThat(string).isNotNull();
				event.getApplicationContext().getBeanFactory().registerSingleton("test", string);
			});
		});
		ConfigurableApplicationContext applicationContext = application.run();
		assertThat(applicationContext.getBean("test")).isEqualTo("boot");
	}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free