(轉)引入了junti包 無法使用@Test解決辦法

引入了junti包 無法使用@Test解決辦法

2018年07月08日 10:46:34 燦夏 閱讀數:4448

 版權聲明:本文爲博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/majishushu/article/details/80957437

今天自己做練習的時候發現junit的@Test註解無法用。發現原因是junit的@Test註解默認配置是只能在名稱爲test的目錄下面使用,改一下配置就好了。如下圖

去掉圖中箭頭標註的scope一行就行了。改完後的配置如下。


 
  1. <dependency>

  2. <groupId>junit</groupId>

  3. <artifactId>junit</artifactId>

  4. <version>4.7</version>

  5. <scope>test</scope>

  6. </dependency>

  7.  
  8. <dependency>

  9. <groupId>junit</groupId>

  10. <artifactId>junit</artifactId>

  11. <version>${junit.version}</version>

  12. </dependency>

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