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

bindToInstanceShouldBindToInstance() — spring-boot Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba["bindToInstanceShouldBindToInstance()"]
  dec6e978_683d_a8e4_7ae5_e3e729d3253e["MockConfigurationPropertySource()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| dec6e978_683d_a8e4_7ae5_e3e729d3253e
  725e97d2_341b_6665_84bc_9206c7185c54["put()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| 725e97d2_341b_6665_84bc_9206c7185c54
  7ed947bf_22a1_2781_a2ae_759aa1907445["add()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| 7ed947bf_22a1_2781_a2ae_759aa1907445
  76576a77_87f7_3680_8561_2923813db3c1["of()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| 76576a77_87f7_3680_8561_2923813db3c1
  241955c1_e7fb_47f5_5e8e_e359b477a0ed["get()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| 241955c1_e7fb_47f5_5e8e_e359b477a0ed
  8d9774ec_a690_948a_2152_e2f6fa8dac82["getStringValue()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| 8d9774ec_a690_948a_2152_e2f6fa8dac82
  bac02bab_1710_3bc3_d7aa_a5b605a5361a["getEnumValue()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| bac02bab_1710_3bc3_d7aa_a5b605a5361a
  9a88f17f_9a4e_a23e_eed4_095ba44cf45a["getIntValue()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| 9a88f17f_9a4e_a23e_eed4_095ba44cf45a
  61531d5a_a212_0947_2175_4e40684d01a2["getLongValue()"]
  e92ec36b_432e_0e52_b9e3_9f7b559ee2ba -->|calls| 61531d5a_a212_0947_2175_4e40684d01a2
  style e92ec36b_432e_0e52_b9e3_9f7b559ee2ba 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 105–122

	@Test
	void bindToInstanceShouldBindToInstance() {
		MockConfigurationPropertySource source = new MockConfigurationPropertySource();
		source.put("foo.int-value", "12");
		source.put("foo.long-value", "34");
		source.put("foo.string-value", "foo");
		source.put("foo.enum-value", "foo-bar");
		this.sources.add(source);
		ExampleValueBean bean = new ExampleValueBean();
		ExampleValueBean boundBean = this.binder
			.bind("foo", Bindable.of(ExampleValueBean.class).withExistingValue(bean))
			.get();
		assertThat(boundBean).isSameAs(bean);
		assertThat(bean.getIntValue()).isEqualTo(12);
		assertThat(bean.getLongValue()).isEqualTo(34);
		assertThat(bean.getStringValue()).isEqualTo("foo");
		assertThat(bean.getEnumValue()).isEqualTo(ExampleEnum.FOO_BAR);
	}

Domain

Subdomains

Frequently Asked Questions

What does bindToInstanceShouldBindToInstance() do?
bindToInstanceShouldBindToInstance() is a function in the spring-boot codebase.
What does bindToInstanceShouldBindToInstance() call?
bindToInstanceShouldBindToInstance() calls 9 function(s): MockConfigurationPropertySource, add, get, getEnumValue, getIntValue, getLongValue, getStringValue, of, and 1 more.

Analyze Your Own Codebase

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

Try Supermodel Free