反例
@RunWith(MockitoJunitRunner.class)
public class Test {@Mockpublic SomeBean someBean = new SomeBean();
}
正例
@RunWith(MockitoJunitRunner.class)
public class Test {@Mockpublic SomeBean someBean ;
}
解读
使用@Mock注解的对象不应该被显式赋值,应当由Mockito框架进行管理