【发布时间】:2020-08-04 15:39:54
【问题描述】:
我将我的测试从 JUnit 4 迁移到了 JUnit 5。一切正常,但我之前的注释的翻译:
@IfProfileValue(name = "run.import.tests", values = {"true"})
进入
@EnabledIfSystemProperty(named = "run.import.tests", matches = "true")
没有按预期工作。在迁移之前,我通过参数运行了测试
-Drun.import.tests=true
只有当我通过它时,它们才会被运行。使用 Junit 5,即使使用注释 @EnabledIfSystemProperty(named = "run.import.tests", matches = "true"),即使未设置参数 run.import.tests,也会运行测试。
我做错了吗?
【问题讨论】: