问题是“简单”。与Mockito.verify(myInstance, times(3))类似,在任何测试框架中都有计算对象实例的东西吗? 我的意思是: class Obj {
public void a() {
new Obj();
}
}
@Test
@PrepareInstantiationCounter(Obj.class) // <-- this
我很想知道为什么下面的实例将不能编译: Superclass.Subclass myObject = new Superclass.Subclass();
错误消息如下: No enclosing instance of type Superclass is accessible. Must qualify the allocation with an enclosing instance o