MockitoJUnitRunner
MockitoJUnitRunner is a JUnit 4 test runner provided by the Mockito framework. It allows the use of Mockito's annotation-based feature set in test classes by wiring Mockito annotations automatically during test execution.
To use it, annotate the test class with @RunWith(MockitoJUnitRunner.class). The runner will instantiate and initialize fields
The runner also performs validation of mock usage after each test, helping to detect issues such as
For projects using JUnit 4, MockitoJUnitRunner is one of the common ways to enable mock annotations. Alternatives
For newer projects or those using JUnit 5, MockitoJUnitRunner is not used. JUnit 5 supports the MockitoExtension