Search in sources :

Example 11 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method pop3ShouldDeleteFalse.

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

Example 12 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method pop3WithoutStoreUri.

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

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

the class InboundChannelAdapterParserTests method pop3ShouldDeleteFalseProperty.

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

Example 14 with AbstractMailReceiver

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

the class InboundChannelAdapterParserTests method pop3WithAuthenticator.

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

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

the class InboundChannelAdapterParserTests method imapShouldDeleteFalseProperty.

@Test
public void imapShouldDeleteFalseProperty() {
    AbstractMailReceiver receiver = this.getReceiver("imapShouldDeleteFalseProperty");
    assertEquals(ImapMailReceiver.class, receiver.getClass());
    Boolean value = (Boolean) new DirectFieldAccessor(receiver).getPropertyValue("shouldDeleteMessages");
    assertFalse(value);
}
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