爲什麼我的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;

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