引入了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>