I am trying to write unit test for a validator class that I have. So within my UniqueEmailValidator class, I injected a @Service component to check if it exist.
You need to have a default non argument public constructor.
If you need to pass a Spring component into your validator, you may face a problem in test.
I solved it by having a component which holds a service and has a static method to give the service.