CasePhotoService { public CasePhoto getFirst(long caseId) { return casePhotoDao.getFirst(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_first_of_case_photo_dao() throws Exception { when(casePhotoDao.getFirst(anyLong())).thenReturn(new CasePhoto()); casePhotoService.getFirst(123L); verify(casePhotoDao, times(1)).getFirst(123L); }