我正在尝试在JUnit5测试环境中使用JUnit4。实际上,我现在已经升级了我的pom,使用了更高版本的MOckito和POwerMock.Until,所有的测试都是基于JUnit4的。我将平台和老式依赖项添加到我的pom.xml中。现在,我的JUnit4测试用例没有运行。
早期的pom.xml依赖项
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
Latest pom.xml dependencies
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.3.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.23.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
i m getting below errors
Errors:
[ERROR] IntegratorAccessUpdateTest.testBeanProperties:13 » NullPointer
[ERROR] ActionHistoryTest.testBeanProperties » StackOverflow
[ERROR] ApplicationPreferenceManagerTest.testGetBoolean » NoClassDefFound org/powermoc...
[ERROR] ApplicationPreferenceManagerTest.testGetString » NoClassDefFound org/powermock...
[ERROR] CommonValidatorsDispatcherTest.setUp:25 » IllegalState Could not initialize pl...
[ERROR] CommonValidatorsDispatcherTest.setUp:25 » IllegalState Could not initialize pl...
How can i remove these errors, I am not sure that changing each and every class is feasible.is there is any compatibility issue with the versions? why is it showing stackoverflow error?发布于 2019-02-24 03:56:08
Junit提供了关于如何从Junit4升级到Junit5的指导。https://junit.org/junit5/docs/current/user-guide/#migrating-from-junit4
https://stackoverflow.com/questions/54838115
复制相似问题