Mock
Last updated
Was this helpful?
Last updated
Was this helpful?
1). MockitoAnnotations
2). RunWith
3).
@Mock creates a mock. @InjectMocks creates an instance of the class and injects the mocks that are created with the @Mock(or @Spy) annotations into this instance. Note that you must use @RunWith(MockitoJUnitRunner.class) or Mockito.initMocks(this) to initialize these mocks and inject them.