0
点赞
收藏
分享

微信扫一扫

引入了junit为什么还是用不了@Test注解

天天天蓝loveyou 2022-04-04 阅读 138

在pom.xml配置文件中配置了如下

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.11</version>
  <scope>test</scope>
</dependency>

发现无法使用@Test、@after等等

原因:上述scope配置了Junit可用的位置,test表示只能在src下的test文件夹下面才可以使用。

解决:将<scope>test</scope>删除就可以了。

 

举报

相关推荐

0 条评论