I have some trouble writing the most basic unit test for a job. My problem can be recreated by creating a new job by running grails create-job my in the console.
This will create two files
MyJob.goovy(under the default package myApp - resides in test\unit\myApp)MyJobSpec.groovy(under the default package myApp - resides in grails-app\jobs\myApp)
Now if i try to use the job MyJob in the test, as example
import myApp.MyJob //This is not resolved
@TestMixin(GrailsUnitTestMixin)
class MyJobSpec extends Specification {
def MyJob myJob
I get the compiler error Groovy:unable to resolve class MyJob. Everything so far was automatically created by the plugin. What is going on here? Is there something i did wrong / how do i get this to work?
Using grails 2.3.11.
Aucun commentaire:
Enregistrer un commentaire