Skip to content

Commit 42dd144

Browse files
Alexey Orlyanskyfmbenhassine
Alexey Orlyansky
authored andcommitted
Add test for adding steps to a Flow via "next"
Related to #4432
1 parent 4a67b22 commit 42dd144

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spring-batch-core/src/test/java/org/springframework/batch/core/job/builder/FlowJobBuilderTests.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ void testBuildSingleFlow() {
143143
assertEquals(2, execution.getStepExecutions().size());
144144
}
145145

146+
@Test
147+
void testBuildSingleFlowAddingStepsViaNext() {
148+
Flow flow = new FlowBuilder<Flow>("subflow").next(step1).next(step2).build();
149+
FlowJobBuilder builder = new JobBuilder("flow", jobRepository).start(flow).end().preventRestart();
150+
builder.build().execute(execution);
151+
assertEquals(BatchStatus.COMPLETED, execution.getStatus());
152+
assertEquals(2, execution.getStepExecutions().size());
153+
}
154+
146155
@Test
147156
void testBuildOverTwoLines() {
148157
FlowJobBuilder builder = new JobBuilder("flow", jobRepository).start(step1).on("COMPLETED").to(step2).end();

0 commit comments

Comments
 (0)