Search in sources :

Example 6 with MimePartRule

use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.

the class Test_MimePartRule method isMatchNullMetaData.

@Test(expected = RbvException.class)
public void isMatchNullMetaData() throws RbvException {
    MimePartRule rule = new MimePartRule(expectedMailMessage, 0, false, "isMatchNullMetaData", true);
    assertFalse(rule.isMatch(null));
}
Also used : MimePartRule(com.axway.ats.rbv.imap.rules.MimePartRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 7 with MimePartRule

use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.

the class Test_MimePartRule method isMatchRegularPartNegative.

@Test
public void isMatchRegularPartNegative() throws RbvException {
    //expected true
    MimePartRule rule = new MimePartRule(expectedMailMessage, 2, false, "isMatchRegularPartNegative1", true);
    assertFalse(rule.isMatch(metaData));
    //expected false
    rule = new MimePartRule(expectedMailMessage, 0, false, "isMatchRegularPartNegative2", false);
    assertFalse(rule.isMatch(metaData));
}
Also used : MimePartRule(com.axway.ats.rbv.imap.rules.MimePartRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 8 with MimePartRule

use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.

the class Test_MimePartRule method isMatchAttachmentNegative.

@Test
public void isMatchAttachmentNegative() throws RbvException {
    //expected true
    MimePartRule rule = new MimePartRule(expectedMailMessage, 1, true, "isMatchAttachmentNegative1", true);
    assertFalse(rule.isMatch(metaData));
    //expected false
    rule = new MimePartRule(expectedMailMessage, 0, true, "isMatchAttachmentNegative2", false);
    assertFalse(rule.isMatch(metaData));
}
Also used : MimePartRule(com.axway.ats.rbv.imap.rules.MimePartRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 9 with MimePartRule

use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.

the class Test_MimePartRule method isMatchAttachmentNoSuchPart.

@Test
public void isMatchAttachmentNoSuchPart() throws PackageException, RbvException {
    mailMessage = new MimePackage(Test_MimePartRule.class.getResourceAsStream("mail_with_one_attachment.msg"));
    metaData = new ImapMetaData(mailMessage);
    //expected true
    MimePartRule rule = new MimePartRule(expectedMailMessage, 1, true, "isMatchAttachmentNoSuchPart1", true);
    assertFalse(rule.isMatch(metaData));
    //expected false
    rule = new MimePartRule(expectedMailMessage, 1, true, "isMatchAttachmentNoSuchPart2", false);
    assertTrue(rule.isMatch(metaData));
}
Also used : MimePackage(com.axway.ats.action.objects.MimePackage) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) MimePartRule(com.axway.ats.rbv.imap.rules.MimePartRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

BaseTest (com.axway.ats.rbv.BaseTest)9 MimePartRule (com.axway.ats.rbv.imap.rules.MimePartRule)9 Test (org.junit.Test)9 ImapMetaData (com.axway.ats.rbv.imap.ImapMetaData)4 MimePackage (com.axway.ats.action.objects.MimePackage)2 MetaData (com.axway.ats.rbv.MetaData)1