我有一个测试,其中包括以下EasyMock的1个代码:模拟不再被调用时,从EasyMock的1转换到EasyMock的2/3
persistenceManager.getCount(linkCodeAttributeCriteria);
persistenceManagerControl.setDefaultReturnValue(0);
persistenceManagerControl.replay();
//Run a method
persistenceManagerControl.verify();
现在,我的公司是终于升级他们的EasyMock的代码,我已经把它改成下面的代码:
expect(persistenceManager.getCount(linkCodeAttributeCriteria)).andReturn(0);
replay(persistenceManager);
//Run a method
verify(persistenceManager);
但突然的测试失败说getCount将有望被调用一次,但被称为0次。这是我所触及的唯一代码。为什么这个测试失败?