private void closeIfNotAuthenticated() {
        if (!isAuthenticated()) {
            logger.error(
                    "Closing connection because it is still unauthenticated after {} seconds.",
                    UNAUTHENTICATED_CONN_TTL.get());
            forceCloseConnectionFromServerSide();
        }
    }
@Test
    void closeIfNotAuthenticated() throws Exception {
        doHandshakeComplete();

        Runnable scheduledTask = scheduledCaptor.getValue();
        scheduledTask.run();

        validateConnectionClosed(1000, "Server closed connection");
    }