Search in sources :

Example 16 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method pop3WithSession.

// ==================== INT-1161 ====================
@Test
public void pop3WithSession() {
    AbstractMailReceiver receiver = this.getReceiver("pop3WithSession");
    assertEquals(Pop3MailReceiver.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 17 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method pop3WithMaxFetchSizeFallsBackToPollerMax.

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

Example 18 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method imapWithAuthenticator.

@Test
public void imapWithAuthenticator() {
    AbstractMailReceiver receiver = this.getReceiver("imapWithAuthenticator");
    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 19 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method imapWithoutStoreUri.

@Test
public void imapWithoutStoreUri() {
    AbstractMailReceiver receiver = this.getReceiver("imapWithoutStoreUri");
    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 20 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method imapWithSearchTermStrategy.

// ==================== INT-2800 ====================
@Test
public void imapWithSearchTermStrategy() {
    AbstractMailReceiver receiver = this.getReceiver("imapWithSearch");
    assertEquals(ImapMailReceiver.class, receiver.getClass());
    DirectFieldAccessor receiverAccessor = new DirectFieldAccessor(receiver);
    Object sts = receiverAccessor.getPropertyValue("searchTermStrategy");
    assertNotNull(sts);
    assertSame(context.getBean(SearchTermStrategy.class), sts);
    assertEquals("flagged", receiverAccessor.getPropertyValue("userFlag"));
}
Also used : AbstractMailReceiver(org.springframework.integration.mail.AbstractMailReceiver) SearchTermStrategy(org.springframework.integration.mail.SearchTermStrategy) 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