Skip to content

Commit fe2bc06

Browse files
committed
Added @reflectable to SiteConfigurationNotificationProvider / SiteConfigurationNotificationSmtpConnectionSecurity
1 parent c69281a commit fe2bc06

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

apps/lambda-api/src/test/java/com/formkiq/stacks/api/handler/ConfigurationRequestTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,12 @@ public void testHandlePatchSmtpConfigurationExistingSecret() throws Exception {
604604

605605
// then
606606
assertEquals("Config saved", response.getMessage());
607-
assertEquals(secretArn, this.systemApi.getConfiguration(DEFAULT_SITE_ID).getNotification()
608-
.getSmtp().getCredentialsSecretArn());
607+
NotificationConfig notification =
608+
this.systemApi.getConfiguration(DEFAULT_SITE_ID).getNotification();
609+
assertEquals(NotificationEmailProvider.SMTP, notification.getProvider());
610+
assertEquals(NotificationEmailSmtpConnectionSecurity.STARTTLS,
611+
notification.getSmtp().getConnectionSecurity());
612+
assertEquals(secretArn, notification.getSmtp().getCredentialsSecretArn());
609613
}
610614

611615
/** PATCH SMTP configuration with a credentials Secret that does not exist. */

apps/lambda-s3/src/main/java/com/formkiq/stacks/lambda/s3/actions/NotificationAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private void sendSes(final String source, final String to, final String cc, fina
150150
private void sendSmtp(final SiteConfigurationNotification notification, final String to,
151151
final String cc, final String bcc, final String subject, final String text, final String html)
152152
throws IOException {
153-
153+
154154
SiteConfigurationNotificationSmtp smtp = notification.smtp();
155155
if (smtp == null) {
156156
throw new IOException("SMTP notification configuration is not set");
@@ -164,8 +164,8 @@ private void sendSmtp(final SiteConfigurationNotification notification, final St
164164
String username = getCredential(credentials, "username");
165165
String password = getCredential(credentials, "password");
166166

167-
smtpEmailSender.send(new SmtpEmail(notification.email(), to, cc, bcc, subject, text, html, smtp,
168-
username, password));
167+
smtpEmailSender.send(new SmtpEmail(notification.email(), to, cc, bcc, subject, text, html,
168+
smtp, username, password));
169169

170170
} catch (JsonParseException e) {
171171
throw new IOException("SMTP credentials secret must contain valid JSON", e);

domain/documents/src/main/java/com/formkiq/stacks/dynamodb/config/SiteConfigurationNotificationProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@
2323
*/
2424
package com.formkiq.stacks.dynamodb.config;
2525

26+
import com.formkiq.graalvm.annotations.Reflectable;
27+
2628
/**
2729
* Supported notification email providers.
2830
*/
31+
@Reflectable
2932
public enum SiteConfigurationNotificationProvider {
3033
/** Amazon Simple Email Service. */
3134
SES,

domain/documents/src/main/java/com/formkiq/stacks/dynamodb/config/SiteConfigurationNotificationSmtpConnectionSecurity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@
2323
*/
2424
package com.formkiq.stacks.dynamodb.config;
2525

26+
import com.formkiq.graalvm.annotations.Reflectable;
27+
2628
/**
2729
* Supported SMTP connection security modes.
2830
*/
31+
@Reflectable
2932
public enum SiteConfigurationNotificationSmtpConnectionSecurity {
3033
/** Upgrade a plain connection using STARTTLS. */
3134
STARTTLS,

0 commit comments

Comments
 (0)