@Test public void shouldReturnCurrentPeriodWhenThereAreNotPatientDataReportedAndCurrentPeriodIsOpenToRequisitions() throws LMISException { DateTime today = calculateDateWithinRequisitionPeriod(); LMISTestApp.getInstance().setCurrentTimeMillis(today.getMillis()); when(malariaProgramRepository.getFirstMovement()).thenReturn(null); Period expectedPeriod = new Period(new DateTime(LMISTestApp.getInstance().getCurrentTimeMillis())); List<Period> periods = patientDataService.calculatePeriods(VIAReportType.MALARIA); assertThat(EqualsBuilder.reflectionEquals(expectedPeriod, periods.get(FIRST_PERIOD_POSITION)), is(true)); }
public List<Period> calculatePeriods(VIAReportType VIAReportType) { List<Period> periods = new ArrayList<>(); if (VIAReportType.equals(MALARIA)) { calculateMalariaPeriods(periods); } else { calculatePTVPeriods(periods); } return periods; }
PatientDataService { public List<Period> calculatePeriods(VIAReportType VIAReportType) { List<Period> periods = new ArrayList<>(); if (VIAReportType.equals(MALARIA)) { calculateMalariaPeriods(periods); } else { calculatePTVPeriods(periods); } return periods; } }
PatientDataService { public List<Period> calculatePeriods(VIAReportType VIAReportType) { List<Period> periods = new ArrayList<>(); if (VIAReportType.equals(MALARIA)) { calculateMalariaPeriods(periods); } else { calculatePTVPeriods(periods); } return periods; }  }
PatientDataService { public List<Period> calculatePeriods(VIAReportType VIAReportType) { List<Period> periods = new ArrayList<>(); if (VIAReportType.equals(MALARIA)) { calculateMalariaPeriods(periods); } else { calculatePTVPeriods(periods); } return periods; }  List<Period> calculatePeriods(VIAReportType VIAReportType); List<StockCard> getMalariaProductsStockCards(); List<Long> getMalariaProductsStockHand(); Optional<MalariaProgram> save(MalariaProgram malariaProgram); MalariaProgram findForPeriod(DateTime beginDate, DateTime endDate); List<Product> getMalariaProducts(); }
PatientDataService { public List<Period> calculatePeriods(VIAReportType VIAReportType) { List<Period> periods = new ArrayList<>(); if (VIAReportType.equals(MALARIA)) { calculateMalariaPeriods(periods); } else { calculatePTVPeriods(periods); } return periods; }  List<Period> calculatePeriods(VIAReportType VIAReportType); List<StockCard> getMalariaProductsStockCards(); List<Long> getMalariaProductsStockHand(); Optional<MalariaProgram> save(MalariaProgram malariaProgram); MalariaProgram findForPeriod(DateTime beginDate, DateTime endDate); List<Product> getMalariaProducts();  }