### Question:
WorkLogService implements WorkLogServiceI { @Override public List<WorkLog> reportWorkerWork(Worker worker) { return workLogRepository.findWorkLogsByWorker(worker); } @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 reportWorkerWorkLogs_Success() throws BaseException { WorkLog existingWorkLog = getWorkLogRepositoryStub().getWorkLogList().stream().findAny().get(); List<WorkLog> resultList = workLogService.reportWorkerWork(exisitngWorker()); assertEquals(1, resultList.size()); WorkLog result = resultList.get(0); 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 public void reportWorkerWorkLogs_NoWorkLogs() throws BaseException { List<WorkLog> resultList = workLogService.reportWorkerWork(nonExisitngWorker()); assertTrue(resultList.isEmpty()); }