在maven junit 4.5中没有org.junit.test包

时间:2013-09-04 08:47:16

标签: java maven junit

我对junit版本4.5有maven依赖,并且想要使用@test announciation但是因为该工件没有org.junit.test包。为什么会如此?如何将@test与maven神器一起使用?

1 个答案:

答案 0 :(得分:1)

完全限定的类是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);
    }

}
相关问题