@Override
    public void execute(EventNotificationContext ctx) throws EventNotificationException {
        final SlackEventNotificationConfig config = (SlackEventNotificationConfig) ctx.notificationConfig();
        LOG.debug("SlackEventNotification backlog size in method execute is [{}]", config.backlogSize());

        try {
            SlackMessage slackMessage = createSlackMessage(ctx, config);
            slackClient.send(slackMessage, config.webhookUrl());
        } catch (JsonProcessingException ex) {
            String errorMessage = String.format(Locale.ENGLISH, "Error serializing Slack message object while sending the SlackEventNotification :: %s", ex.getMessage());
            LOG.error(errorMessage, ex);
            final Notification systemNotification = notificationService.buildNow()
                    .addNode(nodeId.getNodeId())
                    .addType(Notification.Type.GENERIC)
                    .addSeverity(Notification.Severity.URGENT)
                    .addDetail("title", "SlackEventNotification Failed")
                    .addDetail("description", errorMessage);

            notificationService.publishIfFirst(systemNotification);
            throw new EventNotificationException("There was an error serializing the Slack message object when sending the SlackEventNotification", ex);
        } catch (TemporaryEventNotificationException exp) {
            //scheduler needs to retry a TemporaryEventNotificationException
            throw exp;
        } catch (PermanentEventNotificationException exp) {
            String errorMessage = String.format(Locale.ENGLISH, "Error sending the SlackEventNotification :: %s", exp.getMessage());
            final Notification systemNotification = notificationService.buildNow()
                    .addNode(nodeId.getNodeId())
                    .addType(Notification.Type.GENERIC)
                    .addSeverity(Notification.Severity.URGENT)
                    .addDetail("title", "SlackEventNotification Failed")
                    .addDetail("description", errorMessage);

            notificationService.publishIfFirst(systemNotification);
            throw exp;

        } catch (Exception exp) {
            throw new EventNotificationException("There was an exception triggering the SlackEventNotification", exp);
        }
    }
@Test(expected = EventNotificationException.class)
    public void executeWithNullEventTimerange() throws EventNotificationException {
        EventNotificationContext yetAnotherContext = getEventNotificationContextToSimulateNullPointerException();
        assertThat(yetAnotherContext.event().timerangeStart().isPresent()).isFalse();
        assertThat(yetAnotherContext.event().timerangeEnd().isPresent()).isFalse();
        assertThat(yetAnotherContext.notificationConfig().type()).isEqualTo(SlackEventNotificationConfig.TYPE_NAME);
        slackEventNotification.execute(yetAnotherContext);
    }