(转)引入了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>

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