What is the cause of this error, and how do I fix it?
At first glance, it seems like a defect in the groovy compiler.
:compileIntegrationTestGroovystartup failed:
C:\src\my-project\src\integration-test\groovy\my\project\MyServiceISpec.groovy: 31: The method setup should be public as it implements the corresponding method from interface my.project.MyTrait
. At [31:5] @ line 31, column 5.
public void setup() {
^
1 error
My grails integration test looks like this:
@Integration
@Rollback
class MyServiceISpec extends Specification implements MyTrait {
@Autowired
MyService service
OtherService otherService = Mock()
public void setup() {
myTraithMethod()
service.otherService = otherService
}
}
My trait looks like this:
trait MyTrait {
public void setup() {
myTraithMethod()
}
private myTraitMethod() {
...
}
}
Update Added public
keyword to the trait setup method.