Skip to content

Commit

Permalink
Add Config Properties to SendMailPublischerTest and Fix blank space
Browse files Browse the repository at this point in the history
Remove space on SendMailPublisher.java and
add EMAIL_PREFIX Properties to SendMailPublisherTest.java

Signed-off-by: Andres Tito <[email protected]>
  • Loading branch information
LaVibeX committed Feb 5, 2024
1 parent 172a374 commit 19b7e5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private void sendNotification(final PublishContext ctx, Notification notificatio
final SendMail sendMail = new SendMail()
.from(smtpFrom)
.to(destinations)
.subject(emailSubjectPrefix + " " + notification.getTitle() )
.subject(emailSubjectPrefix + " " + notification.getTitle())
.body(content)
.bodyMimeType(mimeType)
.host(smtpHostname)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.dependencytrack.model.ConfigPropertyConstants.EMAIL_SMTP_ENABLED;
import static org.dependencytrack.model.ConfigPropertyConstants.EMAIL_SMTP_FROM_ADDR;
import static org.dependencytrack.model.ConfigPropertyConstants.EMAIL_PREFIX;
import static org.dependencytrack.model.ConfigPropertyConstants.EMAIL_SMTP_PASSWORD;
import static org.dependencytrack.model.ConfigPropertyConstants.EMAIL_SMTP_SERVER_HOSTNAME;
import static org.dependencytrack.model.ConfigPropertyConstants.EMAIL_SMTP_SERVER_PORT;
Expand Down Expand Up @@ -86,6 +87,13 @@ public void setUp() throws Exception {
EMAIL_SMTP_FROM_ADDR.getPropertyType(),
EMAIL_SMTP_FROM_ADDR.getDescription()
);
qm.createConfigProperty(
EMAIL_PREFIX.getGroupName(),
EMAIL_PREFIX.getPropertyName(),
"[Dependency-Track]",
EMAIL_PREFIX.getPropertyType(),
EMAIL_PREFIX.getDescription()
);
qm.createConfigProperty(
EMAIL_SMTP_SSLTLS.getGroupName(),
EMAIL_SMTP_SSLTLS.getPropertyName(),
Expand Down

0 comments on commit 19b7e5b

Please sign in to comment.