### Question:
RunLogManager { @Transactional(propagation = Propagation.SUPPORTS) public String downloadLogs(PipelineRun run) { List<RunLog> logs = loadAllLogsByRunId(run.getId()); StringBuilder builder = new StringBuilder(); logs.forEach(log -> builder.append(logsFormatter.formatLog(log)).append('\n')); return builder.toString(); }  @PostConstruct void init(); @Transactional(propagation = Propagation.REQUIRED) RunLog saveLog(final RunLog runLog); @Transactional(propagation = Propagation.SUPPORTS) PipelineTask loadPreviousTaskStatus(PipelineRun pipelineRun, RunLog runLog); @Transactional(propagation = Propagation.SUPPORTS) List<RunLog> loadAllLogsByRunId(Long runId); @Transactional(propagation = Propagation.SUPPORTS) List<RunLog> loadAllLogsForTask(Long runId, String taskName, String parameters); @Transactional(propagation = Propagation.SUPPORTS) List<PipelineTask> loadTasksByRunIdExternal(Long runId); @Transactional(propagation = Propagation.SUPPORTS) List<PipelineTask> loadTasksByRunId(Long runId); @Transactional(propagation = Propagation.SUPPORTS) String loadTaskByInstance(String pod, PipelineRun pipelineRun); @Transactional(propagation = Propagation.SUPPORTS) String downloadLogs(PipelineRun run);  }### Answer:
@Test public void downloadLogs() throws Exception { PipelineRun run = new PipelineRun(1L, ""); List<RunLog> logs = new ArrayList<>(); logs.add(RunLog.builder().date(Date.from(Instant.now())).task(new PipelineTask(FIRST_TASK)) .logText("First task Log1").build()); logs.add(RunLog.builder().date(Date.from(Instant.now())).task(new PipelineTask(SECOND_TASK)) .logText("Second task Log1").build()); logs.add(RunLog.builder().date(Date.from(Instant.now())).task(new PipelineTask(FIRST_TASK)) .logText("First task Log2").build()); Mockito.when(runManagerMock.loadPipelineRun(run.getId())).thenReturn(run); Mockito.when(logDao.loadAllLogsForRun(run.getId())).thenReturn(logs); String result = logManager.downloadLogs(run); Assert.assertNotNull(result); Assert.assertTrue(!result.isEmpty()); }