Annotations in Mockito

@RunWith(MockitoJUnitRunner.class) Using runner lets you save a little bit of coding (no need for @Before method). On the other hand using a runner is sometimes not possible, i.e. when you are already using one, like SpringJUnit4ClassRunner. @Mock and @InjectMocks @Mock creates a mock on each test method run, and @InjectMocks will pass mocks to any matching setters or constructors…