I have a spring batch application with a single job that runs two steps. I would like to be able to test each step individually without having to run the other. Is this possible? My code is as follows:
@Bean
public Job job() throws Exception {
return jobs.get("job")
.incrementer(new RunIdIncrementer())
.listener(new JobCompletionNotificationListener())
.start(A)
.next(B)
.build();
}
@Test
public void testStepA() {
JobExecution execution = launcher.launchStep("A");
assertEquals(BatchStatus.COMPLETED, execution.getStatus());
}
But when I run the test above it essentially launches and runs my entire job from front to back.