TracingPhotoService { public TracingPhoto getById(long id) { return tracingPhotoDao.getById(id); } TracingPhotoService(TracingPhotoDao tracingDao); static TracingPhotoService getInstance(); TracingPhoto getFirst(long tracingId); TracingPhoto getById(long id); List<Long> getIdsByTracingId(long tracingId); boolean hasUnSynced(long tracingId); void deleteByTracingId(long tracingId); static final String TAG; }
@Test public void should_call_get_by_id_of_tracing_photo_dao() throws Exception { when(tracingPhotoDao.getById(anyLong())).thenReturn(new TracingPhoto()); tracingPhotoService.getById(123L); verify(tracingPhotoDao, times(1)).getById(123L); }