@Override
    public void alert(Anomaly anomaly, boolean autoFixTriggered, long selfHealingStartTime, AnomalyType anomalyType) {
        super.alert(anomaly, autoFixTriggered, selfHealingStartTime, anomalyType);

        if (_slackWebhook == null) {
            LOG.warn("Slack webhook is null, can't send Slack self healing notification");
            return;
        }

        if (_slackChannel == null) {
            LOG.warn("Slack channel name is null, can't send Slack self healing notification");
            return;
        }

        String text = String.format("%s%s detected %s. Self healing %s.%s", _slackPreamble, anomalyType, anomaly,
                _selfHealingEnabled.get(anomalyType) ? String.format("start time %s", utcDateFor(selfHealingStartTime))
                        : "is disabled",
                autoFixTriggered ? "%nSelf-healing has been triggered." : "");

        try {
            sendSlackMessage(new SlackMessage(_slackUser, text, _slackIcon, _slackChannel), _slackWebhook);
        } catch (IOException e) {
            LOG.warn("ERROR sending alert to Slack", e);
        }
    }
@Test
    public void testSlackAlertWithDefaultOptions() {
        _notifier = new MockSlackSelfHealingNotifier(mockTime);
        _notifier._slackWebhook = "http://dummy.slack.webhook";
        _notifier._slackChannel = "#dummy-channel";
        _notifier.alert(failures, false, 1L, KafkaAnomalyType.BROKER_FAILURE);
        assertEquals(1, _notifier.getSlackMessageList().size());
        SlackMessage message = _notifier.getSlackMessageList().get(0);
        assertEquals("#dummy-channel", message.getChannel());
    }