Examples of ArrayOfRecipientsType


Examples of com.microsoft.schemas.exchange.services.x2006.types.ArrayOfRecipientsType

        assertNull(mail.getHeader("Sender"));
    }

    private static ArrayOfRecipientsType assertRecipients()
    {
        ArrayOfRecipientsType mockedArray = mock(ArrayOfRecipientsType.class);
        EmailAddressType[] mockedAddresses = new EmailAddressType[2];
        mockedAddresses[0] = mock(EmailAddressType.class);
        mockedAddresses[1] = mock(EmailAddressType.class);

        when(mockedArray.getMailboxArray()).thenReturn(mockedAddresses);
        when(mockedAddresses[0].getEmailAddress()).thenReturn("email1@domain.com");
        when(mockedAddresses[1].getEmailAddress()).thenReturn("email2@domain.com");

        return mockedArray;
    }
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.types.ArrayOfRecipientsType

    @Test
    public void testToRecipientId()
    {
        MessageType mockedMessage = mock(MessageType.class);
        when(mockedMessage.isSetToRecipients()).thenReturn(true);
        ArrayOfRecipientsType recipients = assertRecipients();
        when(mockedMessage.getToRecipients()).thenReturn(recipients);

        MailboxItem mail = new ExchangeEmail(mockedMessage);
        assertTrue(mail.hasKey("To"));
        assertEquals("email1@domain.com;email2@domain.com;", mail.getHeader("To"));
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.types.ArrayOfRecipientsType

    @Test
    public void testCcRecipientId()
    {
        MessageType mockedMessage = mock(MessageType.class);
        when(mockedMessage.isSetCcRecipients()).thenReturn(true);
        ArrayOfRecipientsType recipients = assertRecipients();
        when(mockedMessage.getCcRecipients()).thenReturn(recipients);

        MailboxItem mail = new ExchangeEmail(mockedMessage);
        assertTrue(mail.hasKey("Cc"));
        assertEquals("email1@domain.com;email2@domain.com;", mail.getHeader("Cc"));
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.types.ArrayOfRecipientsType

    @Test
    public void testBccRecipientId()
    {
        MessageType mockedMessage = mock(MessageType.class);
        when(mockedMessage.isSetBccRecipients()).thenReturn(true);
        ArrayOfRecipientsType recipients = assertRecipients();
        when(mockedMessage.getBccRecipients()).thenReturn(recipients);

        MailboxItem mail = new ExchangeEmail(mockedMessage);
        assertTrue(mail.hasKey("Bcc"));
        assertEquals("email1@domain.com;email2@domain.com;", mail.getHeader("Bcc"));
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.types.ArrayOfRecipientsType

        when(mockedMessage.getBody()).thenReturn(mockedBody);
        when(mockedBody.getStringValue()).thenReturn("Body of an email.");
        when(mockedMessage.isSetSubject()).thenReturn(true);
        when(mockedMessage.getSubject()).thenReturn("Subject of an email.");
        when(mockedMessage.isSetToRecipients()).thenReturn(true);
        ArrayOfRecipientsType recipients = assertRecipients();
        when(mockedMessage.getToRecipients()).thenReturn(recipients);

        MailboxItem mail = new ExchangeEmail(mockedMessage);
        assertTrue(mail.hasKey("Body"));
        assertTrue(mail.hasKey("Subject"));
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.types.ArrayOfRecipientsType

            }
        }

        if (message.isSetToRecipients())
        {
            ArrayOfRecipientsType toRecipients = message.getToRecipients();
            headers.put(TORECIPIENT_KEY, getRecipientString(toRecipients));
        }

        if (message.isSetCcRecipients())
        {
            ArrayOfRecipientsType ccRecipients = message.getCcRecipients();
            headers.put(CCRECIPIENT_KEY, getRecipientString(ccRecipients));
        }

        if (message.isSetBccRecipients())
        {
            ArrayOfRecipientsType bccRecipients = message.getBccRecipients();
            headers.put(BCCRECIPIENT_KEY, getRecipientString(bccRecipients));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.