引入了junti包 无法使用@Test解决办法
2018年07月08日 10:46:34 灿夏 阅读数:4448
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/majishushu/article/details/80957437
今天自己做练习的时候发现junit的@Test注解无法用。发现原因是junit的@Test注解默认配置是只能在名称为test的目录下面使用,改一下配置就好了。如下图
去掉图中箭头标注的scope一行就行了。改完后的配置如下。
-
<dependency> -
<groupId>junit</groupId> -
<artifactId>junit</artifactId> -
<version>4.7</version> -
<scope>test</scope> -
</dependency> -
<dependency> -
<groupId>junit</groupId> -
<artifactId>junit</artifactId> -
<version>${junit.version}</version> -
</dependency>