void handleJobLevelCheckpointException(
            CheckpointProperties checkpointProperties,
            CheckpointException exception,
            long checkpointId) {
        if (!checkpointProperties.isSavepoint()) {
            checkFailureAgainstCounter(exception, checkpointId, failureCallback::failJob);
        }
    }
@Test
    void testTotalCountValue() {
        TestFailJobCallback callback = new TestFailJobCallback();
        CheckpointProperties checkpointProperties = forCheckpoint(NEVER_RETAIN_AFTER_TERMINATION);
        CheckpointFailureManager failureManager = new CheckpointFailureManager(0, callback);
        for (CheckpointFailureReason reason : CheckpointFailureReason.values()) {
            failureManager.handleJobLevelCheckpointException(
                    checkpointProperties, new CheckpointException(reason), -2);
        }

        // IO_EXCEPTION, CHECKPOINT_DECLINED, FINALIZE_CHECKPOINT_FAILURE, CHECKPOINT_EXPIRED and
        // CHECKPOINT_ASYNC_EXCEPTION
        assertThat(callback.getInvokeCounter()).isEqualTo(5);
    }