@Override
    public long get() {
        return kubeClient
                .getConfigMap(configMapName)
                .map(this::getCurrentCounter)
                .orElseThrow(
                        () ->
                                new FlinkRuntimeException(
                                        new KubernetesException(
                                                "ConfigMap "
                                                        + configMapName
                                                        + " does not exist.")));
    }
@Test
    void testGetWhenConfigMapNotExist() throws Exception {
        new Context() {
            {
                runTest(
                        () -> {
                            final KubernetesCheckpointIDCounter checkpointIDCounter =
                                    new KubernetesCheckpointIDCounter(
                                            flinkKubeClient, LEADER_CONFIGMAP_NAME, LOCK_IDENTITY);

                            final String errMsg =
                                    "ConfigMap " + LEADER_CONFIGMAP_NAME + " does not exist.";
                            assertThatThrownBy(
                                            () -> checkpointIDCounter.get(),
                                            "We should get an exception when trying to get checkpoint id counter but ConfigMap does not exist.")
                                    .satisfies(anyCauseMatches(errMsg));
                        });
            }
        };
    }