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

bindShouldFailIfExistingValueIsInvalid() — spring-boot Function Reference

Architecture documentation for the bindShouldFailIfExistingValueIsInvalid() function in ValidationBindHandlerTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  5201addc_7302_9bd8_0c8f_f282f0fa0752["bindShouldFailIfExistingValueIsInvalid()"]
  0f6888bd_415c_a046_17eb_844b4cf7637e["bindAndExpectValidationError()"]
  5201addc_7302_9bd8_0c8f_f282f0fa0752 -->|calls| 0f6888bd_415c_a046_17eb_844b4cf7637e
  8297d150_846a_4cc4_47ca_e6d5a70497f3["bind()"]
  5201addc_7302_9bd8_0c8f_f282f0fa0752 -->|calls| 8297d150_846a_4cc4_47ca_e6d5a70497f3
  9585934b_b9d5_0a5e_94c7_a4344f67965b["withExistingValue()"]
  5201addc_7302_9bd8_0c8f_f282f0fa0752 -->|calls| 9585934b_b9d5_0a5e_94c7_a4344f67965b
  19a274bb_d9c7_a72c_7ab7_6a36d8c8fa78["of()"]
  5201addc_7302_9bd8_0c8f_f282f0fa0752 -->|calls| 19a274bb_d9c7_a72c_7ab7_6a36d8c8fa78
  style 5201addc_7302_9bd8_0c8f_f282f0fa0752 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java lines 136–144

	@Test
	void bindShouldFailIfExistingValueIsInvalid() {
		ExampleValidatedBean existingValue = new ExampleValidatedBean();
		BindValidationException cause = bindAndExpectValidationError(
				() -> this.binder.bind(ConfigurationPropertyName.of("foo"),
						Bindable.of(ExampleValidatedBean.class).withExistingValue(existingValue), this.handler));
		FieldError fieldError = (FieldError) cause.getValidationErrors().getAllErrors().get(0);
		assertThat(fieldError.getField()).isEqualTo("age");
	}

Domain

Subdomains

Frequently Asked Questions

What does bindShouldFailIfExistingValueIsInvalid() do?
bindShouldFailIfExistingValueIsInvalid() is a function in the spring-boot codebase.
What does bindShouldFailIfExistingValueIsInvalid() call?
bindShouldFailIfExistingValueIsInvalid() calls 4 function(s): bind, bindAndExpectValidationError, of, withExistingValue.

Analyze Your Own Codebase

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

Try Supermodel Free