@Override
    public void doRun() {
        if (versionOverride.isPresent()) {
            LOG.debug("Elasticsearch version is set manually. Not running check.");
            return;
        }

        final Optional<SearchVersion> probedVersion = this.versionProbe.probe(this.elasticsearchHosts);

        probedVersion.ifPresent(version -> {
            if (compatible(this.initialElasticsearchVersion, version)) {
                notificationService.fixed(Notification.Type.ES_VERSION_MISMATCH);
            } else {
                LOG.warn("Elasticsearch version currently running ({}) is incompatible with the one Graylog was started " +
                        "with ({}) - a restart is required!", version, initialElasticsearchVersion);
                final Notification notification = notificationService.buildNow()
                        .addType(Notification.Type.ES_VERSION_MISMATCH)
                        .addSeverity(Notification.Severity.URGENT)
                        .addDetail("initial_version", initialElasticsearchVersion.toString())
                        .addDetail("current_version", version.toString());
                notificationService.publishIfFirst(notification);
            }
        });
    }
@Test
    void createsNotificationIfCurrentVersionIsIncompatibleWithInitialOne() {
        returnProbedVersion(Version.of(9, 2, 3));

        createPeriodical(SearchVersion.elasticsearch(8, 1, 2)).doRun();

        assertNotificationWasRaised();
    }