mardi 30 juin 2015

Grails Unit testing GORM global constraints

I have an issue where the global constraints setup in the Config are not working when running unit tests.

This is in my Config.groovy: grails.gorm.default.constraints={ '*'(nullable:true, bindable:true) }

in my test I have tried this: static doWithConfig(c){ c.grails.gorm.default.constraints={ '*'(nullable:true, bindable:true) }

and also in the setupSpec(): grailsApplication.config.grails.gorm.default.constraints={ '*'(nullable:true, bindable:true) }

All I'm doing in my test is trying to create a domain object from a json string. Is there anything special that I should be doing to get this to work in the Unit test?

Aucun commentaire:

Enregistrer un commentaire