1 package info.magnolia.cms.mail; 2 3 9 10 import info.magnolia.cms.mail.templates.MgnlEmail; 11 12 import java.util.Iterator ; 13 14 import org.subethamail.wiser.WiserMessage; 15 16 public class MgnlMailFactoryTest extends AbstractMailTest { 17 18 public void testSimpleMail() throws Exception { 19 MgnlEmail email = factory.getEmailFromType(MailConstants.MAIL_TEMPLATE_TEXT); 20 String subject = "Test simple"; 21 email.setText("Hello bonjour"); 22 email.setSubject(subject); 23 email.setToList(TEST_RECIPIENT); 24 email.setFrom(TEST_SENDER); 25 handler.prepareAndSendMail(email); 26 27 assertTrue(wiser.getMessages().size() == 1); 28 Iterator emailIter = wiser.getMessages().iterator(); 29 WiserMessage message = (WiserMessage) emailIter.next(); 30 assertTrue(message.getMimeMessage().getSubject().equals(subject)); 31 } 32 33 } 34 | Popular Tags |