You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, Executable is one of the classes that Mockito relies on internally for its behavior. Stubbing Executable will therefore lead to undefined behavior. Additionally, it is advised not to mock classes you don't own: https://github.com/mockito/mockito/wiki/How-to-write-good-tests#dont-mock-a-type-you-dont-own We are working on improving the user experience by working on a DoNotMock feature to avoid mocking classes/methods that are known to crash Mockito internals (#1833). Therefore, I am closing this as "Infeasible". Apologies for the uninformative exception that is thrown.
Executable mockExecutable = Mockito.mock(Executable.class);
Above lines failed.
org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: class java.lang.reflect.Executable.
Mockito can only mock non-private & non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.
The text was updated successfully, but these errors were encountered: