Приобрел себе недавно кисточки Revell серии Painta Luxus из куницы. Оказалось очень хорошее и своевременное приобретение. При наборе краски не распушаются, а принимают каплевидную форму; не лезут. Для работы с мелкими деталями и узкими местами - отлично, особенно, что касается самой маленькой 5/0. В общем пока очень ими доволен.
Summary Unit test object validation when validator(s) has a dependency. For instance, we have some custom field and cross-field validators. Want to test their combination. Additionally some of validators have dependencies, injected through constructor or setters. You're not using property injection, right? Shortcut If you are just searching for an answer, here's the fast way: Declare CustomConstraintValidatorFactory that implements javax.validation.ConstraintValidatorFactory Override getInstance method and on facing your constraint validator class instantiate it Otherwise delegate validator construction to org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorFactoryImpl Build validator factory and provide it your CustomConstraintValidatorFactory Build validator, using that factory... Go to demo project on GitHub for details: https://github.com/MrArtemAA/blog-demos/blob/master/test-validator-with-injection/src/test/java/ru/artemaa/...
Комментарии
Отправить комментарий