JobLauncherApplicationRunner returns a success exit code even when no jobs have been run#36060
JobLauncherApplicationRunner returns a success exit code even when no jobs have been run#36060itsAkshayDubey wants to merge 5 commits intospring-projects:2.7.xfrom
Conversation
| .withPropertyValues("spring.batch.job.names:discreteLocalJob,nonConfiguredJob") | ||
| .run((context) -> { | ||
| assertThat(context).hasSingleBean(JobLauncher.class); | ||
| assertThrows(NoSuchJobException.class,()->{ |
There was a problem hiding this comment.
The Spring Boot style rules don't allow JUnit assertThrows(). Please use the AssertJ assertThatIllegalArgumentException() or assertThatExceptionOfType() instead.
|
@itsAkshayDubey Thanks for the PR. As also suggested in the issue comments, it would be better to fail early if any job names are unknown instead of potentially processing some jobs and then failing. Starting in Spring Boot 3.0, some validation is done in a |
|
Hi @scottfrederick , Added suggested changes, kindly have a look. Thanks, |
|
@itsAkshayDubey thank you for making your first contribution to Spring Boot. |
JobLauncherApplicationRunner returns a success exit code even when no jobs have been run.
fix: Rethrowing exception when NoSuchJobException is caught for non configured jobs.
Closes: #35940