Rebase conflict
This commit is contained in:
@@ -41,8 +41,6 @@ import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.job.DefaultJobParametersValidator;
|
||||
import org.springframework.batch.core.job.JobSupport;
|
||||
import org.springframework.batch.core.launch.support.SimpleJobLauncher;
|
||||
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
|
||||
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
|
||||
import org.springframework.batch.core.repository.JobRepository;
|
||||
import org.springframework.batch.core.repository.JobRestartException;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
@@ -269,14 +267,14 @@ public class SimpleJobLauncherTests {
|
||||
private boolean contains(String str, String searchStr) {
|
||||
return str.indexOf(searchStr) != -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test to support BATCH-1770 -> throw in parent thread JobRestartException when
|
||||
* Test to support BATCH-1770 -> throw in parent thread JobRestartException when
|
||||
* a stepExecution is UNKNOWN
|
||||
*/
|
||||
@Test(expected=JobRestartException.class)
|
||||
public void testRunStepStatusUnknown() throws Exception {
|
||||
//try and restart a job where the step execution is UNKNOWN
|
||||
//try and restart a job where the step execution is UNKNOWN
|
||||
//setup
|
||||
String jobName = "test_job";
|
||||
JobRepository jobRepository = mock(JobRepository.class);
|
||||
@@ -285,20 +283,20 @@ public class SimpleJobLauncherTests {
|
||||
Job job = mock(Job.class);
|
||||
JobParametersValidator validator = mock(JobParametersValidator.class);
|
||||
StepExecution stepExecution = mock(StepExecution.class);
|
||||
|
||||
|
||||
when(job.getName()).thenReturn(jobName);
|
||||
when(job.isRestartable()).thenReturn(true);
|
||||
when(job.isRestartable()).thenReturn(true);
|
||||
when(job.getJobParametersValidator()).thenReturn(validator);
|
||||
when(jobRepository.getLastJobExecution(jobName, parameters)).thenReturn(jobExecution);
|
||||
when(stepExecution.getStatus()).thenReturn(BatchStatus.UNKNOWN);
|
||||
when(jobExecution.getStepExecutions()).thenReturn(Arrays.asList(stepExecution));
|
||||
|
||||
|
||||
//setup launcher
|
||||
jobLauncher = new SimpleJobLauncher();
|
||||
jobLauncher.setJobRepository(jobRepository);
|
||||
|
||||
|
||||
//run
|
||||
jobLauncher.run(job, parameters);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user