@Override
    protected JobExceptionsInfoWithHistory handleRequest(
            HandlerRequest<EmptyRequestBody> request, ExecutionGraphInfo executionGraph) {
        final List<Integer> exceptionToReportMaxSizes =
                request.getQueryParameter(UpperLimitExceptionParameter.class);
        final int exceptionToReportMaxSize =
                exceptionToReportMaxSizes.size() > 0
                        ? exceptionToReportMaxSizes.get(0)
                        : MAX_NUMBER_EXCEPTION_TO_REPORT;
        List<FailureLabelFilterParameter.FailureLabel> failureLabelFilter =
                request.getQueryParameter(FailureLabelFilterParameter.class);
        failureLabelFilter =
                failureLabelFilter.size() > 0 ? failureLabelFilter : EMPTY_FAILURE_LABEL_FILTER;
        return createJobExceptionsInfo(
                executionGraph, exceptionToReportMaxSize, failureLabelFilter);
    }
@Test
    void testOnlyRootCause()
            throws HandlerRequestException, ExecutionException, InterruptedException {
        final Throwable rootCause = new RuntimeException("root cause");
        final long rootCauseTimestamp = System.currentTimeMillis();

        final ExecutionGraphInfo executionGraphInfo =
                createExecutionGraphInfo(fromGlobalFailure(rootCause, rootCauseTimestamp));
        final HandlerRequest<EmptyRequestBody> request =
                createRequest(executionGraphInfo.getJobId(), 10);
        final JobExceptionsInfoWithHistory response =
                testInstance.handleRequest(request, executionGraphInfo);

        assertThat(response.getRootException())
                .isEqualTo(ExceptionUtils.stringifyException(rootCause));
        assertThat(response.getRootTimestamp()).isEqualTo(rootCauseTimestamp);
        assertThat(response.isTruncated()).isFalse();
        assertThat(response.getAllExceptions()).isEmpty();

        assertThat(response.getExceptionHistory().getEntries())
                .satisfies(
                        matching(
                                contains(
                                        historyContainsGlobalFailure(
                                                rootCause, rootCauseTimestamp))));
    }