【发布时间】:2019-03-05 04:33:33
【问题描述】:
我正在将我的 JUnit 升级到版本 5,当我运行 JUnit 5 时出现此错误
我在我的 pom 中使用
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
org.powermock.api.mockito.ClassNotPreparedException:
[Ljava.lang.Object;@723ca036 com.xxxxxx.MyClass 类没有准备好 进行测试。
我使用@RunWith(JUnitPlatform.class) 作为我的课堂测试符号
我的代码是
PowerMockito.mockStatic(MyClass.class);
when(MyClass.get(anyString()))
.thenReturn(mock);
【问题讨论】: