我正在对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.
}
}
为什么会这样,有人有什么主意吗?可能是什么原因?