Testing / Mockito Interview Questions
Why static methods cannot be mocked using Mockito?
Mock libraries typically create mocks by dynamic instance creation at runtime, either through interfaces or through inheritance, and as the static method is not associated with any particular instance it is not possible for mocking frameworks (like Mockito, easy mock, etc) to mock Static methods.
Frameworks like PowerMock do have support for static methods that perform bytecode manipulation at runtime in order to mock static methods.
More Related questions...