将服务传递给grails中的非服务?
我有一个非服务类,定义如下:
class A{
B b
A( B b ){ this.b = b }
}
其中B是Grails服务。在我的单元测试中,我试过这个:
A a = new A( new B() );
但是,出于某种原因,b
永远不会被设置,并且在运行测试时,变量b [local, the argument to the mehod]
在Intelli-J的调试器中甚至不可见。也就是说,我可以将参数重命名为service
,调试器将其显示为未定义。
当我尝试启动服务器时,我得到Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
,所以我假设这是相关的。
这里发生了什么?
没有找到相关结果
已邀请:
1 个回复
伐教爸