File tree Expand file tree Collapse file tree
src/main/java/it/aboutbits/springboot/testing/validation/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -117,9 +117,19 @@ private static <P> void assertThatValidationIsCompliantForEachProperty(
117117 var violations = validator .validate (copy );
118118
119119 // Check if there are any violations
120+ var violatingFieldMessages = violations
121+ .stream ()
122+ .map (violation ->
123+ "%s => %s" .formatted (
124+ violation .getPropertyPath ().toString (),
125+ violation .getMessage ()
126+ )
127+ );
128+
120129 assertThat (violations )
121130 .withFailMessage (
122- "More than one property failed to validate during mutation. The supplied parameter possibly contains invalid values."
131+ "More than one property failed to validate during mutation. The supplied parameter possibly contains invalid values: %s" ,
132+ violatingFieldMessages .collect (Collectors .joining (" | " ))
123133 )
124134 .hasSizeLessThan (2 );
125135
You can’t perform that action at this time.
0 commit comments