Mockito - stub abstract parent class method
问题 I am seeing very strange behavior trying to stub a method myMethod(param) of class MyClass that is defined in an abstract parent class MyAbstractBaseClass . When I try to stub (using doReturn("...").when(MyClassMock).myMethod(...) etc.) this method fails, different exceptions are thrown under different scenarios. The exceptions are thrown right on that line. When I use doReturn("...").when(MyClassMock).myMethod(CONCRETE PARAM CLASS OBJECT) , I get the following exception: org.mockito