### Question:
OperationsApiServiceImpl implements OperationsApiService { @Override public ResponseEntity<String> getOperationLogContent(String spaceGuid, String operationId, String logId) { try { String content = logsService.getLogContent(spaceGuid, operationId, logId); return ResponseEntity.ok() .body(content); } catch (FileStorageException e) { throw new ContentException(e, e.getMessage()); } }  @Override ResponseEntity<List<Operation>> getOperations(String spaceGuid, String mtaId, List<String> stateStrings, Integer last); @Override ResponseEntity<Void> executeOperationAction(HttpServletRequest request, String spaceGuid, String operationId, String actionId); @Override ResponseEntity<List<Log>> getOperationLogs(String spaceGuid, String operationId); @Override ResponseEntity<String> getOperationLogContent(String spaceGuid, String operationId, String logId); @Override ResponseEntity<Operation> startOperation(HttpServletRequest request, String spaceGuid, Operation operation); @Override ResponseEntity<Operation> getOperation(String spaceGuid, String operationId, String embed); @Override ResponseEntity<List<String>> getOperationActions(String spaceGuid, String operationId);  }### Answer:
@Test void testGetOperationLogContent() throws Exception { String processId = FINISHED_PROCESS; String logName = "OPERATION.log"; String expectedLogContent = "somelogcontentstring\n1234"; Mockito.when(logsService.getLogContent(Mockito.eq(SPACE_GUID), Mockito.eq(processId), Mockito.eq(logName))) .thenReturn(expectedLogContent); ResponseEntity<String> response = testedClass.getOperationLogContent(SPACE_GUID, processId, logName); String logContent = response.getBody(); assertEquals(expectedLogContent, logContent); }
@Test void testGetOperationLogContentNotFound() throws Exception { String processId = FINISHED_PROCESS; String logName = "OPERATION.log"; Mockito.when(logsService.getLogContent(Mockito.eq(SPACE_GUID), Mockito.eq(processId), Mockito.eq(logName))) .thenThrow(new NoResultException("log file not found")); Assertions.assertThrows(NoResultException.class, () -> testedClass.getOperationLogContent(SPACE_GUID, processId, logName)); }