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

        try {
            final String requestBody = generateBody(ctx, config);
            requestClient.send(requestBody, config.webhookUrl());
        } catch (TemporaryEventNotificationException exp) {
            // Scheduler needs to retry a TemporaryEventNotificationException
            throw exp;
        } catch (PermanentEventNotificationException exp) {
            String errorMessage = StringUtils.f("Error sending Teams Notification ID: %s. %s", ctx.notificationId(), exp.getMessage());
            final Notification systemNotification = notificationService.buildNow()
                    .addNode(nodeId.getNodeId())
                    .addType(Notification.Type.GENERIC)
                    .addSeverity(Notification.Severity.URGENT)
                    .addDetail("title", "TeamsEventNotificationV2 Failed")
                    .addDetail("description", errorMessage);

            notificationService.publishIfFirst(systemNotification);
            throw exp;

        } catch (Exception exp) {
            throw new EventNotificationException("There was an exception triggering the TeamsEventNotification", exp);
        }
    }
@Test(expected = EventNotificationException.class)
    public void executeWithInvalidWebhookUrl() throws EventNotificationException {
        givenGoodNotificationService();
        givenTeamsClientThrowsPermException();
        // When execute is called with an invalid webhook URL, we expect an event notification exception.
        teamsEventNotification.execute(eventNotificationContext);
    }