Good patterns for unit testing form beans that have annotation-based validation in Spring MVC

前端 未结 4 1373
旧时难觅i
旧时难觅i 2020-12-20 13:06

When using annotation based validation for a form bean, what is the best practice for unit-testing those beans in order to ensure that correct validations annotations are sp

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-20 13:56

    You can also write unit tests for your Beans which are annotated usin JSR303 using validator factory. See example: http://musingsofaprogrammingaddict.blogspot.com/2009/02/using-bean-validation-with-spring.html

提交回复
热议问题