@Override
    protected CompletableFuture<LogListInfo> handleRequest(
            @Nonnull HandlerRequest<EmptyRequestBody> request, @Nonnull RestfulGateway gateway)
            throws RestHandlerException {
        if (logDir == null) {
            return CompletableFuture.completedFuture(new LogListInfo(Collections.emptyList()));
        }
        final File[] logFiles = logDir.listFiles();
        if (logFiles == null) {
            return FutureUtils.completedExceptionally(
                    new IOException("Could not list files in " + logDir));
        }
        final List<LogInfo> logs =
                Arrays.stream(logFiles)
                        .filter(File::isFile)
                        .map(
                                logFile ->
                                        new LogInfo(
                                                logFile.getName(),
                                                logFile.length(),
                                                logFile.lastModified()))
                        .collect(Collectors.toList());
        return CompletableFuture.completedFuture(new LogListInfo(logs));
    }
@Test
    void testGetJobManagerLogsListWhenLogDirIsNull() throws Exception {
        JobManagerLogListHandler jobManagerLogListHandler = createHandler(null);
        LogListInfo logListInfo =
                jobManagerLogListHandler.handleRequest(testRequest, dispatcherGateway).get();

        assertThat(logListInfo.getLogInfos()).isEmpty();
    }