Search in sources :

Example 16 with ImapMetaData

use of com.axway.ats.rbv.imap.ImapMetaData 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)

Example 17 with ImapMetaData

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

the class Test_AttachmentNameRule method setUp.

@Before
public void setUp() throws PackageException, RbvException {
    mailMessage = new MimePackage(Test_AttachmentNameRule.class.getResourceAsStream("mail_with_two_attachments.msg"));
    metaData = new ImapMetaData(mailMessage);
}
Also used : MimePackage(com.axway.ats.action.objects.MimePackage) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) Before(org.junit.Before)

Example 18 with ImapMetaData

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

the class Test_MimePartCountRule method isMatchEmptyMetaData.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchEmptyMetaData() throws RbvException {
    MimePartCountRule rule = new MimePartCountRule(5, true, "isMatchEmptyMetaData", true);
    metaData = new ImapMetaData(null);
    assertFalse(rule.isMatch(metaData));
}
Also used : ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) MimePartCountRule(com.axway.ats.rbv.imap.rules.MimePartCountRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 19 with ImapMetaData

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

the class Test_MimePartCountRule method setUp.

@Before
public void setUp() throws Exception {
    MimePackage mailMessage = null;
    mailMessage = new MimePackage(Test_MimePartCountRule.class.getResourceAsStream("mail_with_one_attachment.msg"));
    metaData = new ImapMetaData(mailMessage);
}
Also used : MimePackage(com.axway.ats.action.objects.MimePackage) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) Before(org.junit.Before)

Example 20 with ImapMetaData

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

the class Test_HeaderRule method isMatchEmptyMetaData.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchEmptyMetaData() throws RbvException {
    HeaderRule rule = new HeaderRule("Sender", "infos1.mercatoloterie@gmail.com", HeaderMatchMode.FIND, "isMatchEmptyMetaData", true);
    metaData = new ImapMetaData(null);
    assertFalse(rule.isMatch(metaData));
}
Also used : ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

ImapMetaData (com.axway.ats.rbv.imap.ImapMetaData)20 MimePackage (com.axway.ats.action.objects.MimePackage)15 BaseTest (com.axway.ats.rbv.BaseTest)11 Test (org.junit.Test)11 Before (org.junit.Before)6 StringInMimePartRule (com.axway.ats.rbv.imap.rules.StringInMimePartRule)5 Test_ImapStorage (com.axway.ats.rbv.imap.Test_ImapStorage)4 MimePartRule (com.axway.ats.rbv.imap.rules.MimePartRule)3 BeforeClass (org.junit.BeforeClass)2 NoSuchMimePartException (com.axway.ats.action.objects.model.NoSuchMimePartException)1 PackageException (com.axway.ats.action.objects.model.PackageException)1 HeaderRule (com.axway.ats.rbv.imap.rules.HeaderRule)1 MimePartCountRule (com.axway.ats.rbv.imap.rules.MimePartCountRule)1 SubjectRule (com.axway.ats.rbv.imap.rules.SubjectRule)1 RbvException (com.axway.ats.rbv.model.RbvException)1 InputStream (java.io.InputStream)1