JobInstanceDao extends BaseDao<JobInstance> { public List<JobInstance> findCompleted() { String prefix = "x"; NamedParameter startTimeParam = new NamedParameter(JobInstance.PROPERTY_START_TIME, "startTime", null); NamedParameter endTimeParam = new NamedParameter(JobInstance.PROPERTY_END_TIME, "endTime", null); String sb = buildQlSelect(prefix) + startWhere() + buildWhereClause(Operation.NOT_NULL, prefix, startTimeParam) + getAnd() + buildWhereClause(Operation.NOT_NULL, prefix, endTimeParam); return listWithJQL(sb); } JobInstanceDao(); List<JobInstance> getForStatus(List<JobQueueStatus> statuses); List<JobInstance> findCompleted(); List<JobInstance> findNotCompleted();  }
@Test @Tag(TestGroups.FUNCTIONAL) public void testFindComplete() throws Exception { List<JobInstance> all = dao.findAll(); assertEquals(3, all.size()); List<JobInstance> findCompleted = dao.findCompleted(); assertEquals(1, findCompleted.size()); JobInstance job = findCompleted.get(0); assertEquals(JobQueueStatus.Completed, job.getStatus()); }