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

bindToExistingInstanceShouldLeaveDefaults() — spring-boot Function Reference

Architecture documentation for the bindToExistingInstanceShouldLeaveDefaults() function in JavaBeanBinderTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2["bindToExistingInstanceShouldLeaveDefaults()"]
  dec6e978_683d_a8e4_7ae5_e3e729d3253e["MockConfigurationPropertySource()"]
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2 -->|calls| dec6e978_683d_a8e4_7ae5_e3e729d3253e
  725e97d2_341b_6665_84bc_9206c7185c54["put()"]
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2 -->|calls| 725e97d2_341b_6665_84bc_9206c7185c54
  7ed947bf_22a1_2781_a2ae_759aa1907445["add()"]
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2 -->|calls| 7ed947bf_22a1_2781_a2ae_759aa1907445
  baa14fdd_f0dd_9ae3_6fd6_866b4476c087["setFoo()"]
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2 -->|calls| baa14fdd_f0dd_9ae3_6fd6_866b4476c087
  76576a77_87f7_3680_8561_2923813db3c1["of()"]
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2 -->|calls| 76576a77_87f7_3680_8561_2923813db3c1
  241955c1_e7fb_47f5_5e8e_e359b477a0ed["get()"]
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2 -->|calls| 241955c1_e7fb_47f5_5e8e_e359b477a0ed
  6a01da78_cebe_7f08_01a1_3448c3f4e437["getBar()"]
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2 -->|calls| 6a01da78_cebe_7f08_01a1_3448c3f4e437
  d46fdef4_ac5a_570f_4138_8a10528ffb82["getFoo()"]
  37a03d68_f0ca_0839_9c4c_a04a799bd9a2 -->|calls| d46fdef4_ac5a_570f_4138_8a10528ffb82
  style 37a03d68_f0ca_0839_9c4c_a04a799bd9a2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java lines 146–159

	@Test
	void bindToExistingInstanceShouldLeaveDefaults() {
		MockConfigurationPropertySource source = new MockConfigurationPropertySource();
		source.put("foo.bar", "999");
		this.sources.add(source);
		ExampleDefaultsBean bean = new ExampleDefaultsBean();
		bean.setFoo(888);
		ExampleDefaultsBean boundBean = this.binder
			.bind("foo", Bindable.of(ExampleDefaultsBean.class).withExistingValue(bean))
			.get();
		assertThat(boundBean).isSameAs(bean);
		assertThat(bean.getFoo()).isEqualTo(888);
		assertThat(bean.getBar()).isEqualTo(999);
	}

Domain

Subdomains

Frequently Asked Questions

What does bindToExistingInstanceShouldLeaveDefaults() do?
bindToExistingInstanceShouldLeaveDefaults() is a function in the spring-boot codebase.
What does bindToExistingInstanceShouldLeaveDefaults() call?
bindToExistingInstanceShouldLeaveDefaults() calls 8 function(s): MockConfigurationPropertySource, add, get, getBar, getFoo, of, put, setFoo.

Analyze Your Own Codebase

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

Try Supermodel Free