我尝试使用easyMock在我的对象中测试方法。 我做这样的事情:如何使用EasyMock测试模拟方法
MyObject myObject = createMock(MyObject.class);
expect(myObject.someMethod()).andReturn(someReturn);
replay(myObject);
myObject.methodIwantToTest(); // here assertion or sth like this
verify(myObject);
这样的代码是抛出一个异常methodIwantToTest预计不会。如何测试这种方法?