I found a "fix", sort of.
I edited the @IntegrationTest
annotation on my test class from:
@Integration
to
@Integration(applicationClass = Application.class)
And now it works again.
Interestingly, if I change it back to just @Integration
, it still works. But if I run a clean, and rerun, it stops working. So something is definitely wonky here.
EDIT: I wrote the following test case:
CompilerConfiguration configuration = new CompilerConfiguration()
configuration.setTolerance(1)
println new File("src/integration-test/groovy/my/package/Mytest.groovy").isFile()
// true
def source = new SourceUnit(
new File("src/integration-test/groovy/my/package/MyTest.groovy"),
configuration,
null,
new ErrorCollector(configuration))
println source
// org.codehaus.groovy.control.SourceUnit@19bbb216
println source.source
// org.codehaus.groovy.control.io.FileReaderSource@6cfac0bd
println source.source.URI
// file:/path/to/my/app/src/integration-test/groovy/my/package/MyTest.groovy
println MainClassFinder.searchMainClass(source.source.URI)
// null
The AST transformation @Integration
runs MainClassFinder.searchMainClass
when the applicationClass
property is not set. So this seems to indicate that it for some reason isn't able to automatically find the application class for my app based on the integration test. Then again, I'm not really sure which source unit it actually gets when it runs, so my test case might not be realistic.