{"action":"opened","issue":{"url":"https://api.github.com/repos/grails/grails-core/issues/9072","labels_url":"https://api.github.com/repos/grails/grails-core/issues/9072/labels{/name}","comments_url":"https://api.github.com/repos/grails/grails-core/issues/9072/comments","events_url":"https://api.github.com/repos/grails/grails-core/issues/9072/events","html_url":"https://github.com/grails/grails-core/issues/9072","id":92646171,"number":9072,"title":"Integration tests fail with an IllegalStateException in grails 3.0.2","user":{"login":"tony75","id":3809685,"avatar_url":"https://avatars.githubusercontent.com/u/3809685?v=3","gravatar_id":"","url":"https://api.github.com/users/tony75","html_url":"https://github.com/tony75","followers_url":"https://api.github.com/users/tony75/followers","following_url":"https://api.github.com/users/tony75/following{/other_user}","gists_url":"https://api.github.com/users/tony75/gists{/gist_id}","starred_url":"https://api.github.com/users/tony75/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony75/subscriptions","organizations_url":"https://api.github.com/users/tony75/orgs","repos_url":"https://api.github.com/users/tony75/repos","events_url":"https://api.github.com/users/tony75/events{/privacy}","received_events_url":"https://api.github.com/users/tony75/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-02T14:03:44Z","updated_at":"2015-07-02T14:03:44Z","closed_at":null,"body":"Hi,\r\n\r\nWhen running the integration tests, I get the following exception : \r\n```\r\njava.lang.IllegalStateException: Method on class [User] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.\r\njava.lang.RuntimeException: java.lang.IllegalStateException: Method on class [User] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.\r\n\tat org.grails.web.converters.AbstractConverter.toString(AbstractConverter.java:111)\r\n\tat AnnotationMarshallerSpec.toJsonAndBack(AnnotationMarshallerSpec.groovy:22)\r\n\tat AnnotationMarshallerSpec.Marshaller should serialize properties explicitly belonging to the requested API(AnnotationMarshallerSpec.groovy:30)\r\nCaused by: java.lang.IllegalStateException: Method on class [User] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.\r\n\tat org.grails.datastore.gorm.GormEntity$Trait$Helper.currentGormInstanceApi(GormEntity.groovy:52)\r\n\tat org.grails.datastore.gorm.GormEntity$Trait$Helper.ident(GormEntity.groovy:172)\r\n\tat json.annotations.marshaller.AnnotationMarshaller.marshalObject_closure3(AnnotationMarshaller.groovy:79)\r\n\tat json.annotations.marshaller.AnnotationMarshaller.marshalObject_closure3(AnnotationMarshaller.groovy)\r\n\tat groovy.lang.Closure.call(Closure.java:423)\r\n\tat groovy.lang.Closure.call(Closure.java:417)\r\n\tat groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:143)\r\n\tat groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)\r\n\tat grails.converters.JSON$Builder.execute(JSON.java:488)\r\n\tat grails.converters.JSON.build(JSON.java:166)\r\n\tat json.annotations.marshaller.AnnotationMarshaller.marshalObject(AnnotationMarshaller.groovy:78)\r\n\tat grails.converters.JSON.value(JSON.java:202)\r\n\tat grails.converters.JSON.render(JSON.java:134)\r\n\tat org.grails.web.converters.AbstractConverter.toString(AbstractConverter.java:109)\r\n\t... 2 more\r\n```\r\n\r\nFor example, this integration test class does not work : https://github.com/tony75/grails3-json-annotations-marshaller/blob/master/src/test/groovy/AnnotationMarshallerSpec.groovy"}}