单元测试grails标记
|
我已经写了一个Grails标签,它只是Grails select标签周围的一个很薄的包装
package com.example
class MyTagLib {
def listTrees = {attrs ->
List<TreeDto> allTrees = getMandatoryAttributeValue(attrs, \'trees\')
out << g.select(from: allTrees)
}
}
我已经为该类编写了单元测试,但是在运行它时,执行最后一行时出现以下错误:
groovy.lang.MissingMethodException:否
方法签名:
com.example.MyTagLib.select()是
适用于参数类型:
(java.util.LinkedHashMap)
在运行单元测试时,似乎对g
名称空间中grails标记的引用不可用。我已经尝试创建集成测试,但这也不起作用。
有没有一种方法可以测试测试一个调用另一个标签的标签,而不用存根/模拟另一个标签的输出?
没有找到相关结果
已邀请:
1 个回复
宠封钞轰