Skip to content

Commit 19d5f25

Browse files
wilkinsonasnicoll
authored andcommitted
Polish "Adapt to latest changes in Spring Batch 6"
See gh-46447
1 parent 024dba4 commit 19d5f25

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

module/spring-boot-batch/src/main/java/org/springframework/boot/batch/autoconfigure/BatchAutoConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public class BatchAutoConfiguration {
8181
@Bean
8282
@ConditionalOnMissingBean
8383
@ConditionalOnBooleanProperty(name = "spring.batch.job.enabled", matchIfMissing = true)
84-
public JobLauncherApplicationRunner jobLauncherApplicationRunner(JobOperator jobOperator, BatchProperties properties) {
84+
public JobLauncherApplicationRunner jobLauncherApplicationRunner(JobOperator jobOperator,
85+
BatchProperties properties) {
8586
JobLauncherApplicationRunner runner = new JobLauncherApplicationRunner(jobOperator);
8687
String jobName = properties.getJob().getName();
8788
if (StringUtils.hasText(jobName)) {

module/spring-boot-batch/src/test/java/org/springframework/boot/batch/autoconfigure/JobLauncherApplicationRunnerTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ void retryFailedExecutionWithoutIncrementer() {
115115
PlatformTransactionManager transactionManager = context.getBean(PlatformTransactionManager.class);
116116
JobLauncherApplicationRunnerContext jobLauncherContext = new JobLauncherApplicationRunnerContext(context);
117117
Job job = jobLauncherContext.jobBuilder()
118-
.start(jobLauncherContext.stepBuilder().tasklet(throwingTasklet(), transactionManager).build())
119-
.build();
118+
.start(jobLauncherContext.stepBuilder().tasklet(throwingTasklet(), transactionManager).build())
119+
.build();
120120
JobParameters jobParameters = new JobParametersBuilder().addLong("run.id", 1L).toJobParameters();
121121
jobLauncherContext.runner.execute(job, jobParameters);
122122
jobLauncherContext.runner.execute(job, jobParameters);
@@ -152,8 +152,7 @@ void retryFailedExecutionOnNonRestartableJob() {
152152
.preventRestart()
153153
.start(jobLauncherContext.stepBuilder().tasklet(throwingTasklet(), transactionManager).build())
154154
.build();
155-
JobParameters jobParameters = new JobParametersBuilder()
156-
.addString("name", "foo").toJobParameters();
155+
JobParameters jobParameters = new JobParametersBuilder().addString("name", "foo").toJobParameters();
157156
jobLauncherContext.runner.execute(job, jobParameters);
158157
assertThat(jobLauncherContext.jobInstances()).hasSize(1);
159158
assertThatExceptionOfType(JobRestartException.class).isThrownBy(() -> {

0 commit comments

Comments
 (0)