@Override
    public CompletableFuture<ApplicationStatus> getShutDownFuture() {
        return shutDownFuture;
    }
@Test
    public void getShutDownFuture_whileRunning_forwardsDispatcherLeaderProcessShutDownRequest()
            throws Exception {
        final UUID leaderSessionId = UUID.randomUUID();
        final CompletableFuture<ApplicationStatus> shutDownFuture = new CompletableFuture<>();
        final TestingDispatcherLeaderProcess testingDispatcherLeaderProcess =
                TestingDispatcherLeaderProcess.newBuilder(leaderSessionId)
                        .setShutDownFuture(shutDownFuture)
                        .build();
        testingDispatcherLeaderProcessFactory =
                TestingDispatcherLeaderProcessFactory.from(testingDispatcherLeaderProcess);

        try (final DispatcherRunner dispatcherRunner = createDispatcherRunner()) {
            leaderElection.isLeader(leaderSessionId);

            final CompletableFuture<ApplicationStatus> dispatcherShutDownFuture =
                    dispatcherRunner.getShutDownFuture();

            assertFalse(dispatcherShutDownFuture.isDone());

            final ApplicationStatus finalApplicationStatus = ApplicationStatus.UNKNOWN;
            shutDownFuture.complete(finalApplicationStatus);

            assertThat(dispatcherShutDownFuture.get(), is(finalApplicationStatus));
        }
    }