@Test注解使用时报错

2022-11-01 09:55:44

在使用@Test测试时出现报错有3种可能

1 @Test下面的必须是public

2 导包问题

导入的包必须是org.junit.Test

 3 pom.xml没有正确引用

附上代码

<dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
  • 作者:Sunshine_WangD
  • 原文链接:https://blog.csdn.net/Sunshine_WangD/article/details/121864297
    更新时间:2022-11-01 09:55:44