@@ -87,6 +87,21 @@ public class SimpleJobRepository implements JobRepository {
|
||||
this.ecDao = ecDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getJobNames() {
|
||||
return this.jobInstanceDao.getJobNames();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JobInstance> findJobInstancesByName(String jobName, int start, int count) {
|
||||
return this.jobInstanceDao.findJobInstancesByName(jobName, start, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JobExecution> findJobExecutions(JobInstance jobInstance) {
|
||||
return this.jobExecutionDao.findJobExecutions(jobInstance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJobInstanceExists(String jobName, JobParameters jobParameters) {
|
||||
return jobInstanceDao.getJobInstance(jobName, jobParameters) != null;
|
||||
|
||||
@@ -130,6 +130,38 @@ class SimpleJobRepositoryTests {
|
||||
jobExecution = new JobExecution(new JobInstance(1L, job.getName()), 1L, jobParameters);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetJobNames() {
|
||||
// when
|
||||
this.jobRepository.getJobNames();
|
||||
|
||||
// then
|
||||
verify(this.jobInstanceDao).getJobNames();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFindJobInstancesByName() {
|
||||
// given
|
||||
String jobName = "job";
|
||||
int start = 1;
|
||||
int count = 10;
|
||||
|
||||
// when
|
||||
this.jobRepository.findJobInstancesByName(jobName, start, count);
|
||||
|
||||
// then
|
||||
verify(this.jobInstanceDao).findJobInstancesByName(jobName, start, count);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFindJobExecutions() {
|
||||
// when
|
||||
this.jobRepository.findJobExecutions(this.jobInstance);
|
||||
|
||||
// then
|
||||
verify(this.jobExecutionDao).findJobExecutions(this.jobInstance);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSaveOrUpdateInvalidJobExecution() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user