Grails 2.1 Unit Testing Command Object mockForConstraintsTests not working?

前端 未结 3 397
逝去的感伤
逝去的感伤 2021-01-20 04:45

I have used manually written as well as Grails generated Unit tests for this command object:

   package myapp

    @grails.validation.Validateable
    class          


        
3条回答
  •  [愿得一人]
    2021-01-20 04:58

    I believe I found the grails supported way to unit test Command objects in grails 2.0. You need to use mockCommandObject provided by the ControllerUnitTestMixin.

    Credit to Erik

    http://www.jworks.nl/2012/04/12/testing-command-objects-in-grails-2-0/

提交回复
热议问题