gpt4 book ai didi

java - JUnit5 是否向后兼容 JUnit4?

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:53:28 24 4
gpt4 key购买 nike

我用谷歌搜索了很多;但我既找不到消息来源说“当然是”,也找不到消息来源说“不,不是;这里它坏了”。

我们使用 EasyMock、PowerMock、Mockito 进行了大约 2000 个质量参差不齐的单元测试;我只是想知道:当切换到 JUnit5 时,这 2000 个测试用例是否有合理的机会正常工作?还是这不太可能,我最好不要花一秒钟的时间去尝试?

换句话说:我正在寻找可以确认“是的,它适用于我们的大型代码库”的答案;或“不,这根本不是那么容易”。

最佳答案

JUnit 5 User Guide 所述:

Just make sure that the junit-vintage-engine artifact is in your test runtime path. In that case JUnit 3 and JUnit 4 tests will automatically be picked up by the JUnit Platform launcher.

See the example projects in the junit5-samples repository to find out how this is done with Gradle and Maven.

关于java - JUnit5 是否向后兼容 JUnit4?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41635164/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com