我有一个看起来与此类似的规格:
def "my spec"(Record record) {
given:
Something something = getSomething()
and:
otherThing = getOtherThing()
doFlow(something, record)
if (record.someType = Types.SOME_SPECIFIC_TYPE) {
doFlow(something, record)
}
}
def doFlow(Something something, Record record) {
when:
//code
then:
//asserts
when:
//code
and:
//mode code
then:
//code
}
然而,在运行时,我遇到了以下问题:
groovy.lang.MissingMethodException: 找不到可适用于 Something、Record values: [given values] 的 doFlow() 方法签名。