Package org.subethamail.wiser

Examples of org.subethamail.wiser.WiserMessage


        assertThat(messages.size())
                .isEqualTo(1)
                .as("One email was sent");

        WiserMessage wiserMessage = messages.get(0);

        assertThat(wiserMessage.getEnvelopeReceiver())
                .isEqualTo("admin@example.com")
                .as("The email recipient is the administrator");

        String content = HasEmailRule.getEmailContent(wiserMessage);
View Full Code Here


        assertThat(messages.size())
                .isEqualTo(1)
                .as("One email was sent");

        WiserMessage wiserMessage = messages.get(0);

        assertThat(wiserMessage.getEnvelopeReceiver())
                .isEqualTo("admin@example.com")
                .as("The email recipient is the administrator");

        String content = HasEmailRule.getEmailContent(wiserMessage);
View Full Code Here

    public String getMessageAsString(int intMsgNo)
    {
        List receivedMessages = fakeMailServer.getMessages();
        assertTrue("mail server didn't get enough messages", receivedMessages.size() >= intMsgNo);

        WiserMessage emailMessage = (WiserMessage) receivedMessages.get(intMsgNo);

        if (emailMessage != null)
        {
            try
            {
View Full Code Here

        boolean boolSaveToFile)
        throws IOException
    {
        assertTrue("mail server doesn't contain expected message",
                mailServer.getMessages().size() == 1);
        WiserMessage emailMessage = (WiserMessage) mailServer.getMessages().get(0);

        if (boolSaveToFile)
        {
            this.saveEmailToFile(emailMessage);
        }

        try
        {
            // get the MimeMessage
            MimeMessage mimeMessage = emailMessage.getMimeMessage();

            // test subject
            assertEquals("got wrong subject from mail",
                    strSubject, mimeMessage.getHeader("Subject", null));
View Full Code Here

        List bccAdd,
        boolean boolSaveToFile)
        throws IOException
    {
        // test other properties
        WiserMessage emailMessage = this.validateSend(
            mailServer,
            strSubject,
            fromAdd,
            toAdd,
            ccAdd,
View Full Code Here

        List bccAdd,
        boolean boolSaveToFile)
        throws IOException
    {
        // test other properties
        WiserMessage emailMessage = this.validateSend(
            mailServer,
            strSubject,
            fromAdd,
            toAdd,
            ccAdd,
View Full Code Here

    runtimeService.startProcessInstanceByKey("sendMailExample", vars);
   
    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());
   
    WiserMessage message = messages.get(0);
    MimeMessage mimeMessage = message.getMimeMessage();
   
    assertEquals("Your order " + orderId + " has been shipped", mimeMessage.getHeader("Subject", null));
    assertEquals("\"" + from + "\" <" +from.toString() + ">" , mimeMessage.getHeader("From", null));
    assertTrue(mimeMessage.getHeader("To", null).contains(recipient));
  }
View Full Code Here

    runtimeService.startProcessInstanceByKey("sendMailExample", vars);
   
    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());
   
    WiserMessage message = messages.get(0);
    MimeMessage mimeMessage = message.getMimeMessage();
   
    assertEquals("Your order " + orderId + " has been shipped", mimeMessage.getHeader("Subject", null));
    assertEquals("\"" + from + "\" <" +from.toString() + ">" , mimeMessage.getHeader("From", null));
    assertTrue(mimeMessage.getHeader("To", null).contains(recipient));
  }
View Full Code Here

        getBodyAndClose(registerResponse);

        // then - should have sent correct email
        TimeUnit.SECONDS.sleep(2);
        assertThat(wiser.getMessages(), is(not(empty())));
        WiserMessage registrationWiserMessage = wiser.getMessages().get(0);
        MimeMessage mimeMessage = registrationWiserMessage.getMimeMessage();
        NewRegistrationEmail registrationEmail = new NewRegistrationEmail(mimeMessage.getContent().toString());
        String updatePasswordURL = registrationEmail.shouldHaveCorrectFields("fake@email.com");

        // when - updating password
        HttpResponse updatePasswordPageResponse = httpClient.execute(new HttpGet(updatePasswordURL));
View Full Code Here

  }

  protected void assertResponse(Wiser wiser, Future<Boolean> response) throws MessagingException, ExecutionException, InterruptedException {
    Assert.assertTrue(response.get());
    Assert.assertEquals(1, wiser.getMessages().size());
    WiserMessage msg = wiser.getMessages().get(0);
    assertMessage(msg);
  }
View Full Code Here

TOP

Related Classes of org.subethamail.wiser.WiserMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.