Search in sources :

Example 6 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method imapIdleWithAuthenticator.

@Test
public void imapIdleWithAuthenticator() {
    AbstractMailReceiver receiver = this.getReceiver("imapIdleWithAuthenticator");
    assertEquals(ImapMailReceiver.class, receiver.getClass());
    Object authenticator = new DirectFieldAccessor(receiver).getPropertyValue("javaMailAuthenticator");
    assertNotNull(authenticator);
    assertEquals(context.getBean("testAuthenticator"), authenticator);
}
Also used : AbstractMailReceiver(org.springframework.integration.mail.AbstractMailReceiver) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.Test)

Example 7 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method imapIdleWithMaxFetchSize.

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

Example 8 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method pop3WithMaxFetchSize.

// ==================== INT-1160 ====================
@Test
public void pop3WithMaxFetchSize() {
    AbstractMailReceiver receiver = this.getReceiver("pop3WithMaxFetchSize");
    assertEquals(Pop3MailReceiver.class, receiver.getClass());
    Object value = new DirectFieldAccessor(receiver).getPropertyValue("maxFetchSize");
    assertEquals(11, value);
}
Also used : AbstractMailReceiver(org.springframework.integration.mail.AbstractMailReceiver) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.Test)

Example 9 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method imapWithSession.

@Test
public void imapWithSession() {
    AbstractMailReceiver receiver = this.getReceiver("imapWithSession");
    assertEquals(ImapMailReceiver.class, receiver.getClass());
    Object session = new DirectFieldAccessor(receiver).getPropertyValue("session");
    assertNotNull(session);
    assertEquals(context.getBean("testSession"), session);
}
Also used : AbstractMailReceiver(org.springframework.integration.mail.AbstractMailReceiver) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.Test)

Example 10 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method pop3ShouldDeleteTrue.

// ==================== INT-982 =====================
@Test
public void pop3ShouldDeleteTrue() {
    AbstractMailReceiver receiver = this.getReceiver("pop3ShouldDeleteTrue");
    assertEquals(Pop3MailReceiver.class, receiver.getClass());
    DirectFieldAccessor receiverAccessor = new DirectFieldAccessor(receiver);
    Boolean value = (Boolean) receiverAccessor.getPropertyValue("shouldDeleteMessages");
    assertTrue(value);
    assertEquals(Boolean.FALSE, receiverAccessor.getPropertyValue("embeddedPartsAsBytes"));
    assertNotNull(receiverAccessor.getPropertyValue("headerMapper"));
}
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