The plugin generates boilerplate Mockito code that usually needs to be added manually to unit tests.
RunWith(MockitoJUnitRunner.class) annotation for the class
- Mocked fields for each non-static object declared in the test subject
- Field for the test subject with
- static imports for useful mockito functions like
To generate the Mockito code with the plugin hit
ctrl shift M or use a choose the action from "Generate Action" context menu.
Recent change notes
- Added generation of mocked fields for objects declared in a parent class of the tested class
- Show error message when plugin used without Mockito or JUnit in the dependencies
General usage instructions
To generate the Mockito code with the plugin hit ctrl shift M or use a choose the action from "Generate Action" context menu.