mock configuration in Grails tests
grails, groovy, mocking, unit-testing
Solution
You have access to grailsApplication.config so you can modify these values as much as you need, so you can do
grailsApplication.config.some.config.setting = 'foo'
Problem
Prior to Grails 2.0.X it was possible to mock configuration using a `mockConfig` method provided by the base class that tests extend. However, in Grails 2.0.X it is recommended that test classes use the `@TestFor` mixin instead of extending a base class. This mixin doesn't seem to provide anything equivalent to the `mockConfig` methods, so I can't figure out how to mock values in `Config.groovy`.