报错信息
org.mockito.exceptions.misusing.NotAMockException: Argument passed to Mockito.mockingDetails() should be a mock, but is an instance of class java.lang.Class!
at org.mockito.internal.runners.StrictRunner.run(StrictRunner.java:52)
at org.mockito.junit.MockitoJUnitRunner.run(MockitoJUnitRunner.java:163)
at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:53)
解决方案
删掉 @RunWith(MockitoJUnitRunner.class)
加上
@Before
public void before(){
log.info("start--------{}",this.getClass().getName());
MockitoAnnotations.openMocks(this);
}