I have externalize the steps to flow so i can reuse from 2 seperate jobs. I remove item reader chunk etc.
Code:
<batch:flow id="reusableFlow">
<batch:step id="stepA" next="stepB">
......
</batch:step>
<batch:step id="stepB" >
......
</batch:step>
</batch:flow>
<batch:job id="job1" incrementer="dateIncrementer">
<batch:step id="job1Step" next="commonStep1">
</batch:step>
<batch:step id="commonStep1">
<batch:flow parent="reusableFlow" />
</batch:step>
</batch:job>
<batch:job id="job2" incrementer="dateIncrementer">
<batch:step id="job2Step" next="commonStep2">
</batch:step>
<batch:step id="commonStep2">
<batch:flow parent="reusableFlow" />
</batch:step>
</batch:job>
</batch:job>
when i want to test steps inside flow giving me error step not found
when i debug then job2 for example contains only 2 steps job2Step and commonStep2 i can test these 2 steps from junit but can't steps defined in flow
Code:
assertEquals(BatchStatus.COMPLETED,
jobLauncherUtils.launchStep("stepA",jobLauncherUtils.getUniqueJobParameters())
.getStatus());