1 package org.kuali.ole.deliver;
2
3 import org.junit.Test;
4 import org.junit.runner.RunWith;
5 import org.kuali.rice.core.api.CoreApiServiceLocator;
6 import org.kuali.rice.core.api.mail.*;
7 import org.springframework.test.context.ContextConfiguration;
8 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
9 import org.springframework.test.context.transaction.TransactionConfiguration;
10
11 import static org.junit.Assert.assertNotNull;
12
13
14
15
16
17
18
19
20 @ContextConfiguration(locations = {"classpath:/SpringBeans.xml"})
21 @RunWith(value = SpringJUnit4ClassRunner.class)
22 @TransactionConfiguration(defaultRollback = true)
23 public class MailNotifier_UT {
24 private String sender = "kuali.ole@gmail.com";
25 private String recipient = "kuali.ole@gmail.com";
26 private String subject = "Test Subject";
27 private String messageBody = "Test Message Body";
28
29
30
31
32
33 @Test
34 public void testSendMessage() {
35
36 Mailer mailer = null;
37 mailer = CoreApiServiceLocator.getMailer();
38 assertNotNull(mailer);
39
40
41 mailer.sendEmail(new EmailFrom(sender), new EmailTo(recipient), new EmailSubject(subject), new EmailBody(messageBody), false);
42
43
44
45
46
47 }
48
49 }