I have read that when using @Mock, it should be used with @RunWith(MockitoJUnitRunner.class), while for @MockBean, it uses with @RunWith(SpringRunner.class).
However, for @Mock, I see that both MockitoJunitRunner or SpringRunner can be used interchangeably. I am rather confused as to why SpringRunner is also working in this situation ?
@RunWith(MockitoJUnitRunner.class) // also work when @RunWith(SpringRunner.class) is used
public class testService {
@InjectMocks
private ServiceA serviceA;
@Mock
private DependencyA dependencyA;
}