TracingPhotoService { public TracingPhoto getFirst(long tracingId) { return tracingPhotoDao.getFirst(tracingId); } 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_first_of_tracing_photo_dao() throws Exception { when(tracingPhotoDao.getFirst(anyLong())).thenReturn(new TracingPhoto()); tracingPhotoService.getFirst(123L); verify(tracingPhotoDao, times(1)).getFirst(123L); }