CaseService extends RecordService { public Case getByInternalId(String id) { return caseDao.getByInternalId(id); } CaseService(CaseDao caseDao, CasePhotoDao casePhotoDao, IncidentDao incidentDao); List<Case> getAll(); Case getById(long caseId); Case getByUniqueId(String uniqueId); List<String> getIncidentsByCaseId(String caseUniqueId); List<Long> getAllOrderByDateASC(); List<Long> getAllOrderByDateDES(); List<Long> getAllOrderByAgeASC(); List<Long> getAllOrderByAgeDES(); List<Long> getCPSearchResult(String shortId, String name, int ageFrom, int ageTo,
                                        String caregiver, Date date); List<Long> getAllSyncedRecordsId(); List<Long> getGBVSearchResult(String shortId, String name, String location, Date registrationDate); Case saveOrUpdate(ItemValuesMap itemValues, List<String> photoPaths); Case save(ItemValuesMap itemValues, List<String> photoPaths); void savePhoto(Case child, List<String> photoPaths); Case update(ItemValuesMap itemValues, List<String> photoBitPaths); void updatePhoto(Case child, List<String> photoPaths); Case deleteByRecordId(long recordId); Case getByInternalId(String id); boolean hasSameRev(String id, String rev); static final String TAG; static final String CASE_DISPLAY_ID; static final String CASE_ID; static final String CASE_PRIMARY_ID; }
@Test public void should_get_case_by_internal_id() throws Exception { Case c = new Case(); when(caseDao.getByInternalId(anyString())).thenReturn(c); assertThat("Should get case", caseService.getByInternalId(""), is(c)); }