How to write a unit testing case for custom spring validator implementation class . For example
public class RegistrationValidator implements Validator.
Just wanted to know the various approaches . Am new to spring so exploring all options.
Thanks,
S
Create an Errors object,
Create an instance of your Validator,
invoke yourValidator(testData, errors)
Check that Errors is modified in the way you expected, in dependence to
testDataBTW: you should have a look at JSR 303-Bean Validation, it is also supported by Spring 3.0. But it is easyer to use (less code) for the most use cases.