spring-projects / spring-batch

Spring Batch is a framework for writing batch applications using Java and Spring
http://projects.spring.io/spring-batch/
Apache License 2.0
2.73k stars 2.35k forks source link

JobLauncherTestUtils#launchStep fails when using `on` method from SimpleJobBuilder [BATCH-2285] #1320

Closed spring-projects-issues closed 4 years ago

spring-projects-issues commented 10 years ago

Josh Brackett opened BATCH-2285 and commented

If I create a job using:

JobBuilderFactory jobs = new JobBuilderFactory(jobRepository);

return jobs.get("testJob").incrementer(new RunIdIncrementer()).start(step).on("*").to(step2).build().build();

then I get a failure that "No step found with name: ..."

Using

return jobs.get("testJob").incrementer(new RunIdIncrementer()).start(step).next(step2).build();

works as expected.

Perhaps I'm just misunderstanding something or not configuring something correctly so I've created a simple project that replicates what I'm seeing.


Affects: 3.0.1

Reference URL: https://github.com/jbrackett/SpringBatchTestFailure

fmbenhassine commented 4 years ago

Thanks for sharing a minimal example to reproduce the issue!

Without any code modification in the shared repo, the test failing with v3.0.1 passes with Spring Batch v4.2.1.

Since Spring Batch v3 is not maintained anymore and the bug does not happen with v4.2.1, I'm closing this issue.