forked from RedHatInsights/notifications-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RHCLOUD-29084 Support event types subscribed by default in connectors (…
…RedHatInsights#2323) Co-authored-by: Guillaume Duval <[email protected]>
- Loading branch information
Showing
19 changed files
with
500 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
import static com.redhat.cloud.notifications.connector.email.constants.ExchangeProperty.RENDERED_BODY; | ||
import static com.redhat.cloud.notifications.connector.email.constants.ExchangeProperty.RENDERED_SUBJECT; | ||
import static com.redhat.cloud.notifications.connector.email.constants.ExchangeProperty.SUBSCRIBERS; | ||
import static com.redhat.cloud.notifications.connector.email.constants.ExchangeProperty.UNSUBSCRIBERS; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertIterableEquals; | ||
|
||
|
@@ -65,14 +66,16 @@ void testExtract() { | |
recipientSettingsList.add(recipientSettings2); | ||
recipientSettingsList.add(recipientSettings3); | ||
|
||
final List<String> subscribers = List.of("a", "b", "c"); | ||
final Set<String> subscribers = Set.of("a", "b", "c"); | ||
final Set<String> unsubscribers = Set.of("d", "e", "f"); | ||
final String emailBody = "fake email body"; | ||
final String emailSubject = "fake email subject"; | ||
|
||
// Prepare the JSON object. | ||
final JsonObject payload = new JsonObject(); | ||
payload.put("recipient_settings", recipientSettingsList); | ||
payload.put("subscribers", subscribers); | ||
payload.put("unsubscribers", unsubscribers); | ||
payload.put("email_body", emailBody); | ||
payload.put("email_subject", emailSubject); | ||
|
||
|
@@ -87,7 +90,8 @@ void testExtract() { | |
assertEquals(emailBody, exchange.getProperty(RENDERED_BODY, String.class)); | ||
assertEquals(emailSubject, exchange.getProperty(RENDERED_SUBJECT, String.class)); | ||
assertIterableEquals(recipientSettingsList, exchange.getProperty(RECIPIENT_SETTINGS, List.class)); | ||
assertIterableEquals(subscribers, exchange.getProperty(SUBSCRIBERS, List.class)); | ||
assertEquals(subscribers, exchange.getProperty(SUBSCRIBERS, Set.class)); | ||
assertEquals(unsubscribers, exchange.getProperty(UNSUBSCRIBERS, Set.class)); | ||
assertEquals(Set.of("[email protected]", "[email protected]", "[email protected]"), exchange.getProperty(EMAIL_RECIPIENTS, Set.class)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.