PatientDispensationRepository { public List<PatientDispensation> getAllByProgramId(final long id) throws LMISException { return dbUtil.withDao(PatientDispensation.class, dao -> { List<PatientDispensation> patientDispensations = dao.queryBuilder().where().eq("ptvProgramId", id).query(); return patientDispensations; }); } @Inject  PatientDispensationRepository(Context context); boolean save(List<PatientDispensation> patientDispensations); List<PatientDispensation> getAllByProgramId(final long id);  }
@Test public void shouldReturnAnEmptyListWhenThereAreNotPatientDispensationSavedForCurrentProgram() throws LMISException { List<PatientDispensation> patientDispensations = patientDispensationRepository.getAllByProgramId(ptvProgram.getId()); assertThat(patientDispensations.isEmpty(), is(true)); }