Fix tests

See gh-19599
pull/19690/head
Madhura Bhave 5 years ago
parent 139995469a
commit 1fa83757ce

@ -122,7 +122,7 @@ class ValidationBindHandlerTests {
this.sources.add(new MockConfigurationPropertySource("foo.nested.age", "4")); this.sources.add(new MockConfigurationPropertySource("foo.nested.age", "4"));
BindValidationException cause = bindAndExpectValidationError(() -> this.binder.bind( BindValidationException cause = bindAndExpectValidationError(() -> this.binder.bind(
ConfigurationPropertyName.of("foo"), Bindable.of(ExampleValidatedWithNestedBean.class), this.handler)); ConfigurationPropertyName.of("foo"), Bindable.of(ExampleValidatedWithNestedBean.class), this.handler));
assertThat(cause.getValidationErrors().getName().toString()).isEqualTo("foo"); assertThat(cause.getValidationErrors().getName().toString()).isEqualTo("foo.nested");
assertThat(cause.getMessage()).contains("nested.age"); assertThat(cause.getMessage()).contains("nested.age");
assertThat(cause.getMessage()).contains("rejected value [4]"); assertThat(cause.getMessage()).contains("rejected value [4]");
} }

Loading…
Cancel
Save