Search in sources :

Example 21 with AbstractMailReceiver

use of org.springframework.integration.mail.AbstractMailReceiver in project spring-integration by spring-projects.

the class InboundChannelAdapterParserTests method imapWithMaxFetchSize.

@Test
public void imapWithMaxFetchSize() {
    AbstractMailReceiver receiver = this.getReceiver("imapWithMaxFetchSize");
    assertEquals(ImapMailReceiver.class, receiver.getClass());
    Object value = new DirectFieldAccessor(receiver).getPropertyValue("maxFetchSize");
    assertEquals(22, value);
}
Also used : AbstractMailReceiver(org.springframework.integration.mail.AbstractMailReceiver) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.Test)

Example 22 with AbstractMailReceiver

use of org.springframework.integration.mail.AbstractMailReceiver in project spring-integration by spring-projects.

the class InboundChannelAdapterParserTests method imapIdleWithoutStoreUri.

@Test
public void imapIdleWithoutStoreUri() {
    AbstractMailReceiver receiver = this.getReceiver("imapIdleWithoutStoreUri");
    assertEquals(ImapMailReceiver.class, receiver.getClass());
    Object url = new DirectFieldAccessor(receiver).getPropertyValue("url");
    assertNull(url);
}
Also used : AbstractMailReceiver(org.springframework.integration.mail.AbstractMailReceiver) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.Test)

Example 23 with AbstractMailReceiver

use of org.springframework.integration.mail.AbstractMailReceiver in project spring-integration by spring-projects.

the class InboundChannelAdapterParserTests method imapShouldMarkMessagesAsRead.

@Test
public void imapShouldMarkMessagesAsRead() {
    AbstractMailReceiver receiver = this.getReceiver("imapShouldMarkAsReadTrue");
    assertEquals(ImapMailReceiver.class, receiver.getClass());
    DirectFieldAccessor receiverAccessor = new DirectFieldAccessor(receiver);
    Boolean value = (Boolean) receiverAccessor.getPropertyValue("shouldMarkMessagesAsRead");
    assertTrue(value);
    assertEquals(Boolean.TRUE, receiverAccessor.getPropertyValue("embeddedPartsAsBytes"));
    assertNull(receiverAccessor.getPropertyValue("headerMapper"));
}
Also used : AbstractMailReceiver(org.springframework.integration.mail.AbstractMailReceiver) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.Test)

Example 24 with AbstractMailReceiver

use of org.springframework.integration.mail.AbstractMailReceiver in project spring-integration by spring-projects.

the class InboundChannelAdapterParserTests method imapShouldDeleteTrue.

@Test
public void imapShouldDeleteTrue() {
    AbstractMailReceiver receiver = this.getReceiver("imapShouldDeleteTrue");
    assertEquals(ImapMailReceiver.class, receiver.getClass());
    DirectFieldAccessor receiverAccessor = new DirectFieldAccessor(receiver);
    Boolean value = (Boolean) receiverAccessor.getPropertyValue("shouldDeleteMessages");
    assertTrue(value);
    assertEquals(Boolean.TRUE, receiverAccessor.getPropertyValue("simpleContent"));
}
Also used : AbstractMailReceiver(org.springframework.integration.mail.AbstractMailReceiver) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.Test)

Aggregations

AbstractMailReceiver (org.springframework.integration.mail.AbstractMailReceiver)24 Test (org.junit.Test)23 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)23 ImapMailReceiver (org.springframework.integration.mail.ImapMailReceiver)1 Pop3MailReceiver (org.springframework.integration.mail.Pop3MailReceiver)1 SearchTermStrategy (org.springframework.integration.mail.SearchTermStrategy)1