MigrateUserJobConfig { @Bean public Job migrateUserJob() throws Exception { return jobBuilderFactory.get("migrateUserJob") .incrementer(new RunIdIncrementer()) .flow(step1()) .end() .build(); } @Autowired  MigrateUserJobConfig(JobBuilderFactory jobBuilderFactory, StepBuilderFactory stepBuilderFactory, DataSource dataSource); @Bean Job migrateUserJob();  }
@Test public void migrateUserJob() throws Exception { JobExecution jobExecution = jobLauncherTestUtils.launchJob(); Assert.assertEquals(jobExecution.getStatus(), BatchStatus.COMPLETED); }