【发布时间】:2013-02-05 08:54:42
【问题描述】:
我有一个与Integration testing Grails services with injection 类似的问题:
@TestFor(DocumentosService)
class DocumentosServiceTest extends GroovyTestCase {
def myService
void testEnvioEmailDocumento() {
assert myService != null
}
}
执行测试时,myService 始终为空。 为什么 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 也为空。
【问题讨论】:
标签: testing grails integration-testing grails-2.1