public void publishRestartEvents(Pod pod, RestartReasons reasons) {
        MicroTime k8sEventTime = new MicroTime(K8S_MICROTIME.format(ZonedDateTime.now(clock)));
        ObjectReference podReference = createPodReference(pod);

        try {
            for (RestartReason reason : reasons) {
                String note = maybeTruncated(reasons.getNoteFor(reason));
                String type = "Normal";
                String k8sFormattedReason = reason.pascalCased();
                LOG.debug("Publishing K8s event, time {}, type, {}, reason, {}, note, {}, pod, {}",
                        k8sEventTime, type, k8sFormattedReason, note, podReference);
                publishEvent(k8sEventTime, podReference, k8sFormattedReason, type, note);
            }
        } catch (Exception e) {
            LOG.error("Exception on K8s event publication", e);
        }
    }
@Test
    void testOneEventPublishedPerReason() {
        Pod mockPod = Mockito.mock(Pod.class);
        ObjectMeta mockPodMeta = new ObjectMetaBuilder().withName("pod").withNamespace("ns").build();
        when(mockPod.getMetadata()).thenReturn(mockPodMeta);


        KubernetesClient client = mock(KubernetesClient.class);

        Set<String> capturedReasons = new HashSet<>();
        KubernetesRestartEventPublisher capturingPublisher = new KubernetesRestartEventPublisher(client, "op") {
            @Override
            protected void publishEvent(MicroTime eventTime, ObjectReference podReference, String reason, String type, String note) {
                capturedReasons.add(reason);
            }
        };

        Set<String> expectedReasons = Set.of("ClientCaCertKeyReplaced", "ClusterCaCertKeyReplaced");

        RestartReasons reasons = new RestartReasons().add(RestartReason.CLIENT_CA_CERT_KEY_REPLACED)
                                                     .add(RestartReason.CLUSTER_CA_CERT_KEY_REPLACED);

        capturingPublisher.publishRestartEvents(mockPod, reasons);

        assertThat(capturedReasons, is(expectedReasons));


    }