Refactoring in MethodValidationAdapter
Extract the default logic for resolving the name of an @Valid parameter into an ObjectNameResolver, and use it when there isn't one configured. See gh-30644
This commit is contained in:
@@ -101,7 +101,7 @@ public class MethodValidationAdapterTests {
|
||||
MyService target = new MyService();
|
||||
Method method = getMethod(target, "addStudent");
|
||||
|
||||
this.validationAdapter.setBindingResultNameResolver((parameter, value) -> "studentToAdd");
|
||||
this.validationAdapter.setObjectNameResolver((param, value) -> "studentToAdd");
|
||||
|
||||
testArgs(target, method, new Object[] {faustino1234, new Person("Joe"), 1}, ex -> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user