为什么我的junit5使用假言/判定(Assumptions)就抛异常呢?

项目要求,考虑使用junit5的假言/判定(Assumptions)来实现不同情况进行不同的测试.

参考下面文章:

https://howtodoinjava.com/junit5/junit-5-assumptions-examples/

https://cloud.tencent.com/developer/article/1383483

https://www.eclipse.org/eclipse/news/4.7.1a/#junit-5-support

发现自己做的测试类总是抛异常.不会进行skip显示.

对比发现,原来是@Test注解的import不正确.

旧:import org.junit.Test;

新:import org.junit.jupiter.api.Test;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章