I am trying to test the just the invocation of a final method to be verified. I do not want to execute that.
//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);
How to just check the method1 invocation without executing when spied?
Thank You !