Add getUniqueJobParametersBuilder() method in JobLauncherTestUtils
Issue #767
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
ac485ee326
commit
60bbc0052a
@@ -26,6 +26,7 @@ import org.springframework.batch.core.Job;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobParameter;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.JobParametersBuilder;
|
||||
import org.springframework.batch.core.Step;
|
||||
import org.springframework.batch.core.job.AbstractJob;
|
||||
import org.springframework.batch.core.job.SimpleJob;
|
||||
@@ -165,6 +166,14 @@ public class JobLauncherTestUtils {
|
||||
return new JobParameters(parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new JobParametersBuilder object containing only a parameter for the
|
||||
* current timestamp, to ensure that the job instance will be unique.
|
||||
*/
|
||||
public JobParametersBuilder getUniqueJobParametersBuilder() {
|
||||
return new JobParametersBuilder(this.getUniqueJobParameters());
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenient method for subclasses to grab a {@link StepRunner} for running
|
||||
* steps by name.
|
||||
|
||||
Reference in New Issue
Block a user