我正在使用 jMock,我对如何模拟我想成为任何 entityClass 的参数感到困惑?
这是我要匹配的方法:
public <T> List<T> find(Query query, Class<T> entityClass) { }
这是我得到的。我想匹配第二个参数上的任何内容:
allowing(template).find(with(any(Query.class)), Foo.class);
这不起作用,因为我在第一个参数上使用了 with。无论存在什么参数,我基本上都想模拟这种方法。