Commit 4ab72621 authored by Simon Reis's avatar Simon Reis
Browse files

SI-158 Tests update

parent ebba72ad
...@@ -91,19 +91,23 @@ public class EmailManagerTest { ...@@ -91,19 +91,23 @@ public class EmailManagerTest {
} }
@Test @Test
public void testSendMail_invalidRecipient() throws Exception { public void testSendMail_invalidRecipient() {
EmailManager emailManager = new GfiEmail(null, "emailConfigurationTest/emailTemplates/emailTemplateTestFehlerRecipient.txt", false, this.emailConfig); assertThrows(MessagingException.class, () -> {
assertThrows(MessagingException.class, emailManager::sendEmail); EmailManager emailManager = new GfiEmail(null, "emailConfigurationTest/emailTemplates/emailTemplateTestFehlerRecipient.txt", false, this.emailConfig);
emailManager.sendEmail();
});
} }
@Test @Test
public void testSendMail_invalidSender() throws Exception { public void testSendMail_invalidSender() {
EmailConfig emailConfig = new EmailConfig(); EmailConfig emailConfig = new EmailConfig();
emailConfig.setSmtpHost("localhost"); emailConfig.setSmtpHost("localhost");
emailConfig.setEmailPort("3025"); emailConfig.setEmailPort("3025");
emailConfig.setSender("testCaseSendertest.de"); emailConfig.setSender("testCaseSendertest.de");
EmailManager emailManager = new GfiEmail(null, "emailConfigurationTest/emailTemplates/emailTemplateTestFehlerRecipient.txt", false, emailConfig); assertThrows(MessagingException.class, () -> {
assertThrows(MessagingException.class, emailManager::sendEmail); EmailManager emailManager = new GfiEmail(null, "emailConfigurationTest/emailTemplates/emailTemplateTestFehlerRecipient.txt", false, emailConfig);
emailManager.sendEmail();
});
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment