I am using grails 4 to create unit test for controller https://testing.grails.org/latest/guide/index.html
My controller is under grails-app/controllers/mypack/myfolder/exampleController.groovy
My unit test is under src/test/groovy/mypack/myfolder/exampleControllerSpec.groovy
my unit test is like this class exampleControllerSpec extends Specification implements ControllerUnitTest< exampleController>
but it complain can not resolve symbol 'exampleController'
anything wrong here?
how to import exampleController
grails-app/controllers/mypack/myfolder/exampleController.groovyandsrc/test/groovy/mypack/myfolder/exampleControllerSpec.groovylook likepackage mypack.myfolder? Separate from that, class names that begin with a lower case letter (likeexampleControllerandexampleControllerSpec) are considered a violations of best practice. - Jeff Scott Brownsrc/test/groovy/mypack/myfolder/exampleControllerSpec.groovyand also mentionsDemoControllerSpec. Have you defined a class namedDemoControllerSpecin a file namedexampleControllerSpec.groovy? - Jeff Scott Brown