Reputation: 67892
I've created a test-type for selenium types, and now I'd like to use grails.serverURL
as the base url for the system under test.
Using ConfigSlurper
on Config.groovy
doesn't pick up the environmentally-conditioned grails.serverURL
, and ConfigurationHolder.config
is null.
How do I access grails.serverURL
in unit tests? (Really my custom-test-phase that runs like a unit test)
Upvotes: 0
Views: 282
Reputation: 67892
You need to pass GrailsUtil.environment
to the ConfigSlurper
constructor.
def config = new ConfigSlurper(GrailsUtil.environment).parse(new File('grails-app/conf/Config.groovy').toURL())
Upvotes: 2