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 testPopulatesExpectedFields() {
        @SuppressWarnings("unchecked")
        Resource<Event> mockEventResource = mock(Resource.class);

        @SuppressWarnings("unchecked")
        NonNamespaceOperation<Event, EventList, Resource<Event>> nonNamespaceOp = mock(NonNamespaceOperation.class);
        ArgumentCaptor<Event> eventCaptor = ArgumentCaptor.forClass(Event.class);
        when(nonNamespaceOp.resource(eventCaptor.capture())).thenReturn(mockEventResource);

        @SuppressWarnings("unchecked")
        MixedOperation<Event, EventList, Resource<Event>> mixedOp = mock(MixedOperation.class);
        when(mixedOp.inNamespace(eq(NAMESPACE))).thenReturn(nonNamespaceOp);

        V1EventingAPIGroupDSL v1EventingAPIGroupDSL = mock(V1EventingAPIGroupDSL.class);
        when(v1EventingAPIGroupDSL.events()).thenReturn(mixedOp);

        EventingAPIGroupDSL eventingAPIGroupDSL = mock(EventingAPIGroupDSL.class);
        when(eventingAPIGroupDSL.v1()).thenReturn(v1EventingAPIGroupDSL);

        KubernetesClient client = mock(KubernetesClient.class);
        when(client.events()).thenReturn(eventingAPIGroupDSL);

        Pod pod = new PodBuilder()
                .withNewMetadata()
                .withName(POD_NAME)
                .withNamespace(NAMESPACE)
                .endMetadata()
                .build();

        Clock clock = Clock.fixed(Instant.parse("2020-10-11T00:00:00Z"), Clock.systemUTC().getZone());

        KubernetesRestartEventPublisher eventPublisher = new KubernetesRestartEventPublisher(client, "cluster-operator-id", clock);

        RestartReasons reasons = new RestartReasons().add(RestartReason.FILE_SYSTEM_RESIZE_NEEDED);
        eventPublisher.publishRestartEvents(pod, reasons);

        verify(mockEventResource, times(1)).create();

        Event publishedEvent = eventCaptor.getValue();
        assertThat(publishedEvent.getRegarding().getKind(), is("Pod"));
        assertThat(publishedEvent.getRegarding().getName(), is(POD_NAME));
        assertThat(publishedEvent.getRegarding().getNamespace(), is(NAMESPACE));

        assertThat(publishedEvent.getReportingController(), is("strimzi.io/cluster-operator"));
        assertThat(publishedEvent.getReportingInstance(), is("cluster-operator-id"));

        assertThat(publishedEvent.getReason(), is("FileSystemResizeNeeded"));
        assertThat(publishedEvent.getAction(), is("StrimziInitiatedPodRestart"));
        assertThat(publishedEvent.getType(), is("Normal"));
        assertThat(publishedEvent.getNote(), is(RestartReason.FILE_SYSTEM_RESIZE_NEEDED.getDefaultNote()));
        assertThat(publishedEvent.getEventTime().getTime(), is("2020-10-11T00:00:00.000000Z"));

    }