Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grails test-app Only classes and closures can be used for attribute 'value' in @grails.test.mixin.TestFor

I'm starting with testing for Grails (version 2.2.4).

When I run: grails test-app

I got:

Error Compilation error compiling [unit] tests: startup failed:

Log:

/myproject/test/unit/app/AutocompleteServiceTests.groovy: 11: Only classes and closures can be used for attribute 'value' in @grails.test.mixin.TestFor
 @ line 11, column 10.
  @TestFor(AutocompleteService)

/myproject/test/unit/app/CoachControllerTests.groovy: 11: Only classes and closures can be used for attribute 'value' in @grails.test.mixin.TestFor
 @ line 11, column 10.
  @TestFor(CoachController)

I have 21 errors, one per each *Test.groovy file.

I tried: grails clean before, but I have the same error.

The Test files was created autmatically by Grails when I create new Domain, Controller or Service.

like image 494
Ignacio Ocampo Avatar asked Dec 14 '13 04:12

Ignacio Ocampo


1 Answers

I found the problem.

I have unit test for models or controllers that was deleted, renamed or changed package.

I deleted all the unit test files and I created each one manually and it works.

like image 75
Ignacio Ocampo Avatar answered Oct 27 '22 06:10

Ignacio Ocampo