From 0f2d91c7e0baa486f6d1045504145b28f67adf40 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 19 Sep 2017 19:19:36 +0200 Subject: [PATCH] Fix broken build Hibernate Validator 6 has a slightly different structure for default messages. This commit adapts our tests accordingly. See gh-9969 --- .../analyzer/BindValidationFailureAnalyzerTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java b/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java index 6612138ca80..008e572cd98 100644 --- a/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BindValidationFailureAnalyzerTests.java @@ -66,11 +66,11 @@ public class BindValidationFailureAnalyzerTests { FailureAnalysis analysis = performAnalysis( FieldValidationFailureConfiguration.class); assertThat(analysis.getDescription()) - .contains(failure("test.foo.foo", "null", "may not be null")); + .contains(failure("test.foo.foo", "null", "must not be null")); assertThat(analysis.getDescription()) .contains(failure("test.foo.value", "0", "at least five")); assertThat(analysis.getDescription()) - .contains(failure("test.foo.nested.bar", "null", "may not be null")); + .contains(failure("test.foo.nested.bar", "null", "must not be null")); } @Test @@ -93,13 +93,13 @@ public class BindValidationFailureAnalyzerTests { public void otherBindExceptionShouldReturnAnalysis() throws Exception { BindException cause = new BindException(new FieldValidationFailureProperties(), "fieldValidationFailureProperties"); - cause.addError(new FieldError("test", "value", "may not be null")); + cause.addError(new FieldError("test", "value", "must not be null")); BeanCreationException rootFailure = new BeanCreationException( "bean creation failure", cause); FailureAnalysis analysis = new BindValidationFailureAnalyzer() .analyze(rootFailure, rootFailure); assertThat(analysis.getDescription()) - .contains(failure("test.value", "null", "may not be null")); + .contains(failure("test.value", "null", "must not be null")); } private static String failure(String property, String value, String reason) {