Grails测试集成服务注入

时间:2015-01-21 08:45:42

标签: grails testing groovy integration-testing

我想进行完整的集成测试,该测试使用将调用其他服务的服务(我使用grails 2.4.3)。 这一切都很好,但是当服务中有服务时,它只会 2级它不会更深入
问题是:如何让测试使用所有必要的子服务

class ImportServiceTests extends GroovyTestCase {  

    def grailsApplication
    def fatherService

    def setup() {
    }

    def cleanup() {
    }

    void 'test1'() {
        String a= fatherService.function() // ->subService -> null
    }
}

1 个答案:

答案 0 :(得分:1)

我的错误是在grails参数的测试调用中

更正
test-app -unit: ...package.class.method -Dgrails.env=integration

test-app integration: ...package.class.method
相关问题