In my Grails app, I have a suite of Geb tests wherein I invoke various GORM methods to save/retrieve data. This was working fine, until very recently. But now, whenever I try to invoke a GORM method from a Geb test, I get the following error:
Method on class [com.example.MyDomainClass] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.
I'm aware of the fact that under certain circumstances you need to use the remote control plugin to use GORM methods in Geb tests. However, in my case, I run the tests via grails test-app functional
and I don't have any JVM forking configured in Config.groovy
. In other words, the tests should be running in the same JVM as the app being tested, so I should be able to use GORM methods without the remote control plugin.
I'm using Grails 2.3.11 and Geb 0.10.0.