我有 junit 版本 4.5 的 Maven 依赖项,并且想要使用 @test 声明,但不能,因为该 Artifact 中没有 org.junit.test 包。为什么会这样以及我如何将 @test 与 Maven Artifact 一起使用?
最佳答案
完全限定的类是org.junit.Test
。肯定就在那里。
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
</dependency>
测试:
import org.junit.Assert;
import org.junit.Test;
public class ThisIsATest {
@Test
public void method() {
Assert.assertTrue("OMG test!", true);
}
}
关于java - maven junit 4.5 中没有 org.junit.test 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18609271/