From the Mockito FAQ:
What are the limitations of Mockito
- Cannot mock final methods – their real behavior is executed without any exception. Mockito cannot warn you about mocking final methods so be vigilant.
More Related Contents:
- Mocking static methods with Mockito
- How to mock void methods with Mockito
- Difference between @Mock and @InjectMocks
- Using Mockito to test abstract classes
- How to tell a Mockito mock object to return something different the next time it is called?
- How to mock new Date() in java using Mockito
- Mockito – @Spy vs @Mock
- What is the difference between mocking and spying when using Mockito?
- mock or stub for chained call
- Why are my mocked methods not calld when executing a unit test?
- Forming Mockito “grammars”
- Why are my mocked methods not called when executing a unit test?
- Mockito – difference between doReturn() and when()
- How do Mockito matchers work?
- Test class with a new() call in it with Mockito
- How to use Mockito with JUnit5
- Mock a constructor with parameter
- Mockito : how to verify method was called on an object created within a method?
- Unit testing with mockito for constructors
- How to write junit tests for interfaces?
- junit & java : testing non-public methods [duplicate]
- How to verify that a specific method was not called using Mockito?
- Mock final class with Mockito 2
- junit testing for user input using Scanner
- Why is my class not calling my mocked methods in unit test?
- throw checked Exceptions from mocks with Mockito
- Calling callbacks with Mockito
- Java verify void method calls n times with Mockito
- How to mock a static method from JMockit
- Mocking behaviour resets after each test with PowerMock