このコードを使用したインジェクションを使用した Grails サービスの統合テストと同様の問題があります。
@TestFor(DocumentosService)
class DocumentosServiceTest extends GroovyTestCase  {
    def myService
    void testEnvioEmailDocumento() {
        assert myService != null
    }
}
テストが実行されると、myService は常に null です。myService が注入されないのはなぜですか? 私はgrails 2.1を使用しています
Burt Beckwith の指示に従って更新 (2013 年 2 月 6 日):
class DocumentosServiceTest extends GroovyTestCase  {
    def myService
    def documentosService
    void testEnvioEmailDocumento() {
        assert documentosService != null
        assert myService != null
    }
}
documentosService も null になりました。