@Test public void shouldGetAllPeriodsInDateRange() throws Exception { Date startDate = DateTime.now().toDate(); Date endDate = DateTime.now().toDate(); List<ProcessingPeriod> expected = new ArrayList<>(); Long scheduleId = 1L; when(mapper.getAllPeriodsForDateRange(scheduleId, startDate, endDate)).thenReturn(expected); List<ProcessingPeriod> actual = repository.getAllPeriodsForDateRange(scheduleId, startDate, endDate); verify(mapper).getAllPeriodsForDateRange(scheduleId, startDate, endDate); assertThat(actual, is(expected)); }
public List<ProcessingPeriod> getAllPeriodsForDateRange(Long scheduleId, Date startDate, Date endDate) { return mapper.getAllPeriodsForDateRange(scheduleId, startDate, endDate); }
ProcessingPeriodRepository { public List<ProcessingPeriod> getAllPeriodsForDateRange(Long scheduleId, Date startDate, Date endDate) { return mapper.getAllPeriodsForDateRange(scheduleId, startDate, endDate); } }
ProcessingPeriodRepository { public List<ProcessingPeriod> getAllPeriodsForDateRange(Long scheduleId, Date startDate, Date endDate) { return mapper.getAllPeriodsForDateRange(scheduleId, startDate, endDate); } @Autowired  ProcessingPeriodRepository(ProcessingPeriodMapper processingPeriodMapper); }
ProcessingPeriodRepository { public List<ProcessingPeriod> getAllPeriodsForDateRange(Long scheduleId, Date startDate, Date endDate) { return mapper.getAllPeriodsForDateRange(scheduleId, startDate, endDate); } @Autowired  ProcessingPeriodRepository(ProcessingPeriodMapper processingPeriodMapper); List<ProcessingPeriod> getAll(Long scheduleId); void insert(ProcessingPeriod processingPeriod); void delete(Long processingPeriodId); List<ProcessingPeriod> getAllPeriodsAfterDateAndPeriod(Long scheduleId, Long startPeriodId, Date afterDate, Date beforeDate); List<ProcessingPeriod> getOpenPeriods(Long facilityId, Long programId, Long startingPeriodId); ProcessingPeriod getById(Long id); List<ProcessingPeriod> getAllPeriodsForDateRange(Long scheduleId, Date startDate, Date endDate); List<ProcessingPeriod> getRnrPeriodsForDateRange(Long facilityId, Long programId, Date startDate, Date endDate); List<ProcessingPeriod> getAllPeriodsBefore(Long scheduleId, Date beforeDate); ProcessingPeriod getCurrentPeriod(Long scheduleId, Date programStartDate); List<ProcessingPeriod> getNPreviousPeriods(ProcessingPeriod currentPeriod, Integer n); ProcessingPeriod getPeriodForDate(Long scheduleId, Date date); List<ProcessingPeriod> getAllPeriodsForScheduleAndYear(Long scheduleId, Long year); }
ProcessingPeriodRepository { public List<ProcessingPeriod> getAllPeriodsForDateRange(Long scheduleId, Date startDate, Date endDate) { return mapper.getAllPeriodsForDateRange(scheduleId, startDate, endDate); } @Autowired  ProcessingPeriodRepository(ProcessingPeriodMapper processingPeriodMapper); List<ProcessingPeriod> getAll(Long scheduleId); void insert(ProcessingPeriod processingPeriod); void delete(Long processingPeriodId); List<ProcessingPeriod> getAllPeriodsAfterDateAndPeriod(Long scheduleId, Long startPeriodId, Date afterDate, Date beforeDate); List<ProcessingPeriod> getOpenPeriods(Long facilityId, Long programId, Long startingPeriodId); ProcessingPeriod getById(Long id); List<ProcessingPeriod> getAllPeriodsForDateRange(Long scheduleId, Date startDate, Date endDate); List<ProcessingPeriod> getRnrPeriodsForDateRange(Long facilityId, Long programId, Date startDate, Date endDate); List<ProcessingPeriod> getAllPeriodsBefore(Long scheduleId, Date beforeDate); ProcessingPeriod getCurrentPeriod(Long scheduleId, Date programStartDate); List<ProcessingPeriod> getNPreviousPeriods(ProcessingPeriod currentPeriod, Integer n); ProcessingPeriod getPeriodForDate(Long scheduleId, Date date); List<ProcessingPeriod> getAllPeriodsForScheduleAndYear(Long scheduleId, Long year);  }