JobParametersIncrementerJobParametersExtractor implements JobParametersExtractor { @Override public JobParameters getJobParameters(Job job, StepExecution stepExecution) { JobParameters result = new JobParameters(); if (job != null && job.getJobParametersIncrementer() != null) { result = job.getJobParametersIncrementer().getNext(new JobParameters()); } return result; }  @Override JobParameters getJobParameters(Job job, StepExecution stepExecution);  }
@Test public void testGetJobParameters() throws Exception { StepExecution stepExecution = MetaDataInstanceFactory.createStepExecution(); FlowJob job = new FlowJob(); job.setJobParametersIncrementer( parameters -> new JobParametersBuilder().addLong(KEY, 0L).toJobParameters() ); JobParameters jobParameters = jobParametersExtractor.getJobParameters(job, stepExecution); Assert.assertNotNull(jobParameters.getLong(KEY)); }