Summary
There are certain JUnit4 runners and JUnit5 extensions that initialize the mocks and spies in the test class. In those cases calling MockitoAnnotations.openMocks() may be unnecessary, at least suspicious.
Tasks
- Create an inspection that can detect JUnit4 runners and JUnit5 extensions on a test class, used in conjunction with
MockitoAnnotations.openMocks().
Questions
- Check if and how superclasses need to be taken into account from both JUnit side and calling
openMocks() side.
Summary
There are certain JUnit4 runners and JUnit5 extensions that initialize the mocks and spies in the test class. In those cases calling
MockitoAnnotations.openMocks()may be unnecessary, at least suspicious.Tasks
MockitoAnnotations.openMocks().Questions
openMocks()side.