gpt4 book ai didi

junit - 来自 JUnit 的 TestNG @RunWith

转载 作者:行者123 更新时间:2023-12-01 18:00:31 26 4
gpt4 key购买 nike

我将从 JUnit 迁移到 TestNG。

我的类已经有一个构造函数,因此我根据要求添加了一个零参数构造函数,现在我注意到 @RunWith 正在使用 org.junit.runner。

我想我需要注释掉import org.junit.runner.RunWith;但是我需要使用的TestNG等效项是什么?

谢谢。

最佳答案

扩展你的测试类
org.springframework.test.context.testng.AbstractTestNGSpringContextTests. 

它相当于 Junit @RunWith

关于junit - 来自 JUnit 的 TestNG @RunWith,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33916610/

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