Allows users to set spring.batch.job.enabled with fail-on-job-failure.
resolves #525
This commit is contained in:
committed by
Michael Minella
parent
7490f8b820
commit
0a179aae61
@@ -32,6 +32,7 @@ import org.springframework.batch.core.configuration.annotation.DefaultBatchConfi
|
||||
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
|
||||
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
|
||||
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
|
||||
import org.springframework.batch.core.explore.JobExplorer;
|
||||
import org.springframework.batch.core.launch.JobLauncher;
|
||||
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
|
||||
import org.springframework.batch.core.scope.context.ChunkContext;
|
||||
@@ -112,6 +113,19 @@ public class TaskJobLauncherCommandLineRunnerTests {
|
||||
enabledArgs);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoTaskJobLauncher() {
|
||||
String[] enabledArgs = new String[] {
|
||||
"--spring.cloud.task.batch.failOnJobFailure=true",
|
||||
"--spring.cloud.task.batch.failOnJobFailurePollInterval=500",
|
||||
"--spring.batch.job.enabled=false" };
|
||||
this.applicationContext = SpringApplication.run(new Class[] {
|
||||
TaskJobLauncherCommandLineRunnerTests.JobWithFailureConfiguration.class },
|
||||
enabledArgs);
|
||||
JobExplorer jobExplorer = this.applicationContext.getBean(JobExplorer.class);
|
||||
assertThat(jobExplorer.getJobNames().size()).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTaskJobLauncherPickOneJob() {
|
||||
String[] enabledArgs = new String[] {
|
||||
|
||||
Reference in New Issue
Block a user