CasePhotoService { public List<Long> getIdsByCaseId(long caseId) { return casePhotoDao.getIdsByCaseId(caseId); } CasePhotoService(CasePhotoDao caseDao); static CasePhotoService getInstance(); CasePhoto getFirst(long caseId); CasePhoto getById(long id); List<Long> getIdsByCaseId(long caseId); boolean hasUnSynced(long caseId); void deleteByCaseId(long caseId); static final String TAG; }
@Test public void should_call_get_ids_by_case_id_of_case_photo_dao() throws Exception { when(casePhotoDao.getIdsByCaseId(anyLong())).thenReturn(Collections.EMPTY_LIST); casePhotoService.getIdsByCaseId(123L); verify(casePhotoDao, times(1)).getIdsByCaseId(123L); }