我正在尝试测试最后一个要验证的方法的调用。我不想执行它。
//First I spied the test class.
TestClass testClass = spy(new TestClass());
//I did something like
doNothing().when(testClass ).method1(parameter);
...
//but in the following line I found the actual method1 is invoked and exceptions are thrown
verify(testClass ).method1(parameter);
如何检查方法1调用而不执行间谍?
谢谢!