This commit is contained in:
Phillip Webb
2023-08-13 18:18:48 -07:00
parent dc45532c94
commit 527b2f2cac
3 changed files with 28 additions and 30 deletions

View File

@@ -117,9 +117,8 @@ public class JobLauncherApplicationRunner
public void afterPropertiesSet() {
if (StringUtils.hasText(this.jobNames)) {
for (String jobName : jobsToRun()) {
if (!isLocalJob(jobName) && !isRegisteredJob(jobName)) {
throw new IllegalArgumentException("No job found with name '" + jobName + "'");
}
Assert.isTrue(isLocalJob(jobName) || isRegisteredJob(jobName),
() -> "No job found with name '" + jobName + "'");
}
}
}