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
I wanted to mock static methods, hence used dependency "mockito-inline" 3.8 version instead of "mockito-core"
The static method mocks work fine but my old tests that mock interfaces fail with the below error
org.mockito.exceptions.misusing.NotAMockException: Argument passed to when() is not a mock! Example of correct stubbing: doThrow(new RuntimeException()).when(mock).someMethod();
Reverting to using mockito-core solves the issue but then I would not be able to mock static methods
Is there any way we can choose different mockito engines (Subclass/Inline) for each class?
Regards
msn
The text was updated successfully, but these errors were encountered:
@msnkishore Exactly how did MockResolver fix the issue? I just ran into this same issue when using v3.4.0, and changing to v3.6.0 (which included #2042 and the MockResolver support) did not resolve the issue. Please tell me how to get Mockito to recognize @SpyBeans - thank you.
Hi,
I wanted to mock static methods, hence used dependency "mockito-inline" 3.8 version instead of "mockito-core"
The static method mocks work fine but my old tests that mock interfaces fail with the below error
org.mockito.exceptions.misusing.NotAMockException: Argument passed to when() is not a mock! Example of correct stubbing: doThrow(new RuntimeException()).when(mock).someMethod();
Reverting to using mockito-core solves the issue but then I would not be able to mock static methods
Is there any way we can choose different mockito engines (Subclass/Inline) for each class?
Regards
msn
The text was updated successfully, but these errors were encountered: