committed by
Mahmoud Ben Hassine
parent
2e8d5063f7
commit
3fe3b7fc5d
@@ -235,6 +235,24 @@ class FlowJobBuilderTests {
|
||||
assertEquals(2, execution.getStepExecutions().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBuildWithDeciderAtStart() {
|
||||
JobExecutionDecider decider = new JobExecutionDecider() {
|
||||
private int count = 0;
|
||||
|
||||
@Override
|
||||
public FlowExecutionStatus decide(JobExecution jobExecution, @Nullable StepExecution stepExecution) {
|
||||
count++;
|
||||
return count < 2 ? new FlowExecutionStatus("ONGOING") : FlowExecutionStatus.COMPLETED;
|
||||
}
|
||||
};
|
||||
JobFlowBuilder builder = new JobBuilder("flow", jobRepository).start(decider);
|
||||
builder.on("COMPLETED").end().from(decider).on("*").to(step1).end();
|
||||
builder.build().preventRestart().build().execute(execution);
|
||||
assertEquals(BatchStatus.COMPLETED, execution.getStatus());
|
||||
assertEquals(1, execution.getStepExecutions().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBuildWithIntermediateSimpleJob() {
|
||||
SimpleJobBuilder builder = new JobBuilder("flow", jobRepository).start(step1);
|
||||
|
||||
Reference in New Issue
Block a user