### Question:
WorkLogService implements WorkLogServiceI { @Override public WorkLog findWorkLogById(Long id) throws BaseException { WorkLog workLog = workLogRepository.findWorkLogById(id); if (workLog == null) { throw new WorkLogDontExistException("Deleting work log dont exists"); } return workLog; } @Inject  WorkLogService(WorkLogRepositoryI workLogRepository, WorkerRepositoryI workerRepository); @Override WorkLog logWork(WorkLog workLog); @Override WorkLog editWorkLog(Long id, WorkLog workLog); @Override WorkLog deleteWorkLog(Long workLogId); @Override List<WorkLog> reportWorkerWork(Worker worker); @Override WorkLog findWorkLogById(Long id);  }### Answer:
@Test public void findWorkLogById_Success() throws BaseException { WorkLog existingWorkLog = getWorkLogRepositoryStub().getWorkLogList().stream().findAny().get(); WorkLog result = workLogService.findWorkLogById(1l); assertEquals(existingWorkLog.getWorkLogId(), result.getWorkLogId()); assertEquals(existingWorkLog.getDescription(), result.getDescription()); assertEquals(existingWorkLog.getStartDate(), result.getStartDate()); assertEquals(existingWorkLog.getTimeSpentInSeconds(), result.getTimeSpentInSeconds()); assertEquals(existingWorkLog.getAssociatedWorker().getLogin(), result.getAssociatedWorker().getLogin()); assertEquals(1, getWorkLogRepositoryStub().getWorkLogList().size()); }
@Test(expected = WorkLogDontExistException.class) public void findWorkLogById_WorkLogDontExist() throws BaseException { workLogService.findWorkLogById(2l); }