Affects Version/s: 2.9.0.RC2
Fix Version/s: None
To reproduce, create a generic grails domain class and open the generated unit test for that domain class.
You will see the following import statements at the top and they both have warnings on them:
The import grails.test.mixin is never used
Then, try deleting the import statement and an error appears on the TestFor annotation and an underline under fail.
Next, replace the imports, and the error and underling disappear. The warnings are also no longer there.
Finally, save, make a whitespace change and re-save. The warnings come back.
My suspicion is that the AST transform that futzes with the imports runs on a build, but not on reconciles. So after changes, the warnings will generally disappear since the imports have not been augmented.
- Always run this particular AST transform, even on reconciles
- Do not show warnings on static or on demand import statements when they are unused
I have also noticed a similar issue in other circumstances. I will raise new bugs for them.