测试覆盖率被其他测试覆盖

时间:2018-10-16 02:10:06

标签: spring spring-batch spring-test

我正在对Spring Batch应用程序进行单元测试。

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes={Reader.class, Writer.class, Job.class, Step.class})
public class MyTest {

@Autowired
private JobLauncherTestUtils jobLauncherTestUtils;

@Test
public void Test1(){
    //some mocking
    jobLauncherTestUtils.launchJob();
    //assertion etc. 
}

//This test is overridding code coverage of the first test. 
@Test
public void Test2(){
    //some mocking
    jobLauncherTestUtils.launchJob();
    //assertion etc. 
}
}

为什么会这样,有人有什么主意吗?可能是什么原因?

0 个答案:

没有答案