我正在为Web应用程序编写Spock测试,并且最近才开始出现此错误:
java.lang.IllegalStateException: can not found call #0 on stack. Invalid
call of record method? at Test.Simple Test(Test.groovy:8)
即使执行简单的健全性检查(如下所示),我仍然会收到此错误。它告诉我错误来自“then”子句之后的内容。
import spock.lang.Specification
class Test extends Specification {
def "Simple Test"() {
when:
def x = 1
then:
x
}
}
任何帮助将不胜感激!
最佳答案
经过四处寻找,我能够找到解决方案。该项目是一个多项目gradle构建,我发现父项目与测试所在的子项目具有冲突的testCompile spock依赖关系。
感谢所有调查此问题的人!
关于java - java.lang.IllegalStateException:在堆栈上找不到调用#0。记录方法调用无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48271472/