use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.
the class Test_MimePartRule method isMatchRegularPartNoSuchPart.
@Test
public void isMatchRegularPartNoSuchPart() 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, 2, false, "isMatchRegularPartNoSuchPart1", true);
assertFalse(rule.isMatch(metaData));
//expected false
rule = new MimePartRule(expectedMailMessage, 2, false, "isMatchRegularPartNoSuchPart2", false);
assertTrue(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.
the class Test_MimePartRule method isMatchRegularPartPositive.
@Test
public void isMatchRegularPartPositive() throws RbvException {
//expected true
MimePartRule rule = new MimePartRule(expectedMailMessage, 0, false, "isMatchRegularPartPositive1", true);
assertTrue(rule.isMatch(metaData));
//expected false
rule = new MimePartRule(expectedMailMessage, 2, false, "isMatchRegularPartPositive2", false);
assertTrue(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.
the class Test_MimePartRule method isMatchWrongMetaData.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchWrongMetaData() throws RbvException {
MimePartRule rule = new MimePartRule(expectedMailMessage, 0, false, "isMatchEmptyMetaData", true);
metaData = new MetaData();
assertFalse(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.
the class Test_MimePartRule method isMatchEmptyMetaData.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchEmptyMetaData() throws RbvException {
MimePartRule rule = new MimePartRule(expectedMailMessage, 0, false, "isMatchEmptyMetaData", true);
metaData = new ImapMetaData(null);
assertFalse(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.MimePartRule in project ats-framework by Axway.
the class Test_MimePartRule method isMatchAttachmentPositive.
@Test
public void isMatchAttachmentPositive() throws RbvException {
//expected true
MimePartRule rule = new MimePartRule(expectedMailMessage, 0, true, "isMatchAttachmentPositive1", true);
assertTrue(rule.isMatch(metaData));
//expected false
rule = new MimePartRule(expectedMailMessage, 1, true, "isMatchAttachmentPositive2", false);
assertTrue(rule.isMatch(metaData));
}
Aggregations