Skip to content

Commit f40dd9f

Browse files
Alexey Orlyanskyfmbenhassine
Alexey Orlyansky
authored andcommitted
Add test for adding steps to a Flow via "next"
Related to #4432 (cherry picked from commit 42dd144)
1 parent adc3a42 commit f40dd9f

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
@@ -142,6 +142,15 @@ void testBuildSingleFlow() {
142142
assertEquals(2, execution.getStepExecutions().size());
143143
}
144144

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

0 commit comments

Comments
 (0)