RnrFormRepository { public boolean hasOldDate() { List<RnRForm> list = null; try { list = list(); } catch (LMISException e) { new LMISException(e, "RnrFormRepository.hasOldDate").reportToFabric(); } Date dueDateShouldDataLivedInDB = DateUtil.dateMinusMonth(new Date(), SharedPreferenceMgr.getInstance().getMonthOffsetThatDefinedOldData()); if (list != null && list.size() > 0) { for (RnRForm rnrForm : list) { if (rnrForm.getPeriodEnd().before(dueDateShouldDataLivedInDB)) { return true; } } } return false; } @Inject  RnrFormRepository(Context context); RnRForm initNormalRnrForm(Date periodEndDate); RnRForm initEmergencyRnrForm(Date periodEndDate, List<StockCard> stockCards); void create(RnRForm rnRForm); void createRnRsWithItems(final List<RnRForm> forms); void createOrUpdateWithItems(final RnRForm form); boolean isPeriodUnique(final RnRForm form); List<RnRForm> list(); List<RnRForm> listInclude(RnRForm.Emergency includeEmergency, String programCode); List<RnRForm> listInclude(RnRForm.Emergency includeEmergency, String programCode, ReportTypeForm reportTypeForm); List<RnRForm> queryAllUnsyncedForms(); RnRForm queryUnAuthorized(); RnRForm queryRnRForm(final long id); List<RnrFormItem> generateRnrFormItems(final RnRForm form, List<StockCard> stockCards); void removeRnrForm(RnRForm form); boolean hasRequisitionData(); boolean hasOldDate(); List<RnRForm> listNotSynchronizedFromReportStartTime(String programCode); void createAndRefresh(RnRForm rnRForm); void deleteOldData(); void deleteRnrFormDirtyData(List<String> productCodeList); @Inject
    public StockMovementRepository stockMovementRepository; }
@Test public void shouldHasZeroData() throws LMISException { assertThat(rnrFormRepository.hasOldDate(), is(false)); }