@Test @Ignore public void shouldGeneratePeriodOfJan21ToFebWhenRnrNotExists() throws Exception { when(mockStockMovementRepository.queryEarliestStockMovementDateByProgram(anyString())).thenReturn(new DateTime("2016-02-17").toDate()); when(mockProgramRepository.queryByCode(anyString())).thenReturn(programMMIA); ReportTypeForm reportTypeForm = new ReportTypeFormBuilder(). setActive(true). setCode(Constants.MMIA_REPORT). setName(Constants.MMIA_PROGRAM_CODE). setStartTime(new DateTime(DateUtil.parseString("2015-01-01", DateUtil.DB_DATE_FORMAT)).toDate()). build(); when(mockReportTypeFormRepository.queryByCode(Constants.MMIA_REPORT)) .thenReturn(reportTypeForm); when(mockReportTypeFormRepository.getReportType(anyString())).thenReturn(reportTypeForm); Period period = requisitionPeriodService.generateNextPeriod(programMMIA.getProgramCode(), null); assertThat(period.getBegin(), is(new DateTime("2016-01-21"))); assertThat(new DateTime(period.getEnd()).getMonthOfYear(), is(2)); }
public Period generateNextPeriod(String programCode, Date physicalInventoryDate) throws LMISException { return generateNextPeriod(programCode, physicalInventoryDate, reportTypeFormRepository.getReportType(programCode)); }
RequisitionPeriodService { public Period generateNextPeriod(String programCode, Date physicalInventoryDate) throws LMISException { return generateNextPeriod(programCode, physicalInventoryDate, reportTypeFormRepository.getReportType(programCode)); } }
RequisitionPeriodService { public Period generateNextPeriod(String programCode, Date physicalInventoryDate) throws LMISException { return generateNextPeriod(programCode, physicalInventoryDate, reportTypeFormRepository.getReportType(programCode)); }  }
RequisitionPeriodService { public Period generateNextPeriod(String programCode, Date physicalInventoryDate) throws LMISException { return generateNextPeriod(programCode, physicalInventoryDate, reportTypeFormRepository.getReportType(programCode)); }  Period generateNextPeriod(String programCode, Date physicalInventoryDate); Period generateNextPeriod(String programCode, Date physicalInventoryDate, ReportTypeForm typeForm); Period generateNextPeriod(List<RnRForm> rnRForms, String programCode, Date physicalInventoryDate); boolean hasMissedPeriod(String programCode); boolean hasMissedPeriod(String programCode, ReportTypeForm reportTypeForm); int getMissedPeriodOffsetMonth(String programCode); int getMissedPeriodOffsetMonth(String programCode, ReportTypeForm typeForm); int getIncompletePeriodOffsetMonth(String programCode); DateTime getCurrentMonthInventoryBeginDate(); }
RequisitionPeriodService { public Period generateNextPeriod(String programCode, Date physicalInventoryDate) throws LMISException { return generateNextPeriod(programCode, physicalInventoryDate, reportTypeFormRepository.getReportType(programCode)); }  Period generateNextPeriod(String programCode, Date physicalInventoryDate); Period generateNextPeriod(String programCode, Date physicalInventoryDate, ReportTypeForm typeForm); Period generateNextPeriod(List<RnRForm> rnRForms, String programCode, Date physicalInventoryDate); boolean hasMissedPeriod(String programCode); boolean hasMissedPeriod(String programCode, ReportTypeForm reportTypeForm); int getMissedPeriodOffsetMonth(String programCode); int getMissedPeriodOffsetMonth(String programCode, ReportTypeForm typeForm); int getIncompletePeriodOffsetMonth(String programCode); DateTime getCurrentMonthInventoryBeginDate();  }