Replace explicit type with diamond operator in test module
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
e4dd5d9c60
commit
42c0614742
@@ -150,7 +150,7 @@ public abstract class AbstractJobTests implements ApplicationContextAware {
|
||||
* current timestamp, to ensure that the job instance will be unique.
|
||||
*/
|
||||
protected JobParameters getUniqueJobParameters() {
|
||||
Map<String, JobParameter> parameters = new HashMap<String, JobParameter>();
|
||||
Map<String, JobParameter> parameters = new HashMap<>();
|
||||
parameters.put("timestamp", new JobParameter(new Date().getTime()));
|
||||
return new JobParameters(parameters);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ExecutionContextTestUtils {
|
||||
@Nullable
|
||||
public static <T> T getValueFromStepInJob(JobExecution jobExecution, String stepName, String key) {
|
||||
StepExecution stepExecution = null;
|
||||
List<String> stepNames = new ArrayList<String>();
|
||||
List<String> stepNames = new ArrayList<>();
|
||||
for (StepExecution candidate : jobExecution.getStepExecutions()) {
|
||||
String name = candidate.getStepName();
|
||||
stepNames.add(name);
|
||||
|
||||
@@ -159,7 +159,7 @@ public class JobLauncherTestUtils {
|
||||
* current timestamp, to ensure that the job instance will be unique.
|
||||
*/
|
||||
public JobParameters getUniqueJobParameters() {
|
||||
Map<String, JobParameter> parameters = new HashMap<String, JobParameter>();
|
||||
Map<String, JobParameter> parameters = new HashMap<>();
|
||||
parameters.put("random", new JobParameter((long) (Math.random() * JOB_PARAMETER_MAXIMUM)));
|
||||
return new JobParameters(parameters);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class JobRepositoryTestUtils extends AbstractJdbcBatchMetadataDao impleme
|
||||
*/
|
||||
public List<JobExecution> createJobExecutions(String jobName, String[] stepNames, int count)
|
||||
throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException {
|
||||
List<JobExecution> list = new ArrayList<JobExecution>();
|
||||
List<JobExecution> list = new ArrayList<>();
|
||||
JobParameters jobParameters = new JobParameters();
|
||||
for (int i = 0; i < count; i++) {
|
||||
JobExecution jobExecution = jobRepository.createJobExecution(jobName, jobParametersIncrementer
|
||||
|
||||
@@ -136,7 +136,7 @@ public class StepRunner {
|
||||
job.setName("TestJob");
|
||||
job.setJobRepository(this.jobRepository);
|
||||
|
||||
List<Step> stepsToExecute = new ArrayList<Step>();
|
||||
List<Step> stepsToExecute = new ArrayList<>();
|
||||
stepsToExecute.add(step);
|
||||
job.setSteps(stepsToExecute);
|
||||
|
||||
@@ -190,7 +190,7 @@ public class StepRunner {
|
||||
* current timestamp, to ensure that the job instance will be unique
|
||||
*/
|
||||
private JobParameters makeUniqueJobParameters() {
|
||||
Map<String, JobParameter> parameters = new HashMap<String, JobParameter>();
|
||||
Map<String, JobParameter> parameters = new HashMap<>();
|
||||
parameters.put("timestamp", new JobParameter(new Date().getTime()));
|
||||
return new JobParameters(parameters);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class JobRepositoryTestUtilsTests {
|
||||
@Test
|
||||
public void testRemoveJobExecutionsWithSameJobInstance() throws Exception {
|
||||
utils = new JobRepositoryTestUtils(jobRepository, dataSource);
|
||||
List<JobExecution> list = new ArrayList<JobExecution>();
|
||||
List<JobExecution> list = new ArrayList<>();
|
||||
JobExecution jobExecution = jobRepository.createJobExecution("job", new JobParameters());
|
||||
jobExecution.setEndTime(new Date());
|
||||
list.add(jobExecution);
|
||||
|
||||
@@ -66,7 +66,7 @@ public class StepScopeAnnotatedListenerIntegrationTests {
|
||||
|
||||
@BeforeStep
|
||||
public void initializeState(StepExecution stepExecution) {
|
||||
this.list = new ArrayList<String>();
|
||||
this.list = new ArrayList<>();
|
||||
}
|
||||
|
||||
@AfterStep
|
||||
|
||||
Reference in New Issue
Block a user