diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/JobStartupRunner.java b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/JobStartupRunner.java index c02a5ed38..4911c83d5 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/scope/JobStartupRunner.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/scope/JobStartupRunner.java @@ -1,12 +1,11 @@ package org.springframework.batch.core.scope; -import javax.annotation.PostConstruct; - import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; +import org.springframework.beans.factory.InitializingBean; -public class JobStartupRunner { +public class JobStartupRunner implements InitializingBean { private Step step; @@ -14,8 +13,7 @@ public class JobStartupRunner { this.step = step; } - @PostConstruct - public void launch() throws Exception { + public void afterPropertiesSet() throws Exception { StepExecution stepExecution = new StepExecution("step", new JobExecution(1L), 0L); step.execute(stepExecution); // expect no errors