使用奇怪的调用参数的 JMock 意外调用

JMock unexpected invocation with weird invocation parameter

鉴于:

A<T>
B extends A<String>

IMyInterface {
  List<T> myMethod(A<T>)
  List<String> myMethod(B)
}

当运行一个调用

的测试
foo = myMethod(new B());

我收到这个 JMock 错误

unexpected invocation: IMyInterface.myMethod(<{}>)

有人知道 (<{}>) 是什么意思吗?

JMock 在格式化错误消息时使用它收到的每个对象的 toString() 实现,所以您看到的可能是 toString() 在您的 [=12] 中实现的结果=] class。 JMock 添加尖括号所以我会说 B.toString() 返回 "{}".