SBT Spring JUnit测试失败,但构建标记为成功

时间:2016-06-03 17:05:22

标签: java spring unit-testing junit sbt

我有一个简单的单元测试,故意失败。失败的测试显示在输出中,但构建成功,没有失败的单元测试。没有SpringJUnit4ClassRunner的正常单元测试按预期失败,并且构建被标记为失败。发生了什么事?

Spring:4.2.6.RELEASE

测试类:

import config.TestAppConfig;
import config.TestDataConfig;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {TestAppConfig.class, TestDataConfig.class})
public class UserTest {
    @Test
    public void testNoDupes() {
        Assert.assertNotNull(null);
    }
}

输出:

[error] Test UserTest.testNoDupes failed: null, took 0.004 sec
[info] Passed: Total 0, Failed 0, Errors 0, Passed 0
[success] Total time: 5 s, completed Jun 3, 2016 11:04:32 AM

0 个答案:

没有答案