use of com.axway.ats.rbv.imap.rules.MimePartCountRule in project ats-framework by Axway.
the class ImapVerification method checkAttachmentNumber.
/**
* Check that a nested IMAP message has the specified number of attachments
*
* @param expectNumAttachments
* @param nestedPackagePath path to the nested message
*/
@PublicAtsApi
public void checkAttachmentNumber(int expectNumAttachments, int... nestedPackagePath) {
//create the rule
MimePartCountRule attachmentCountRule = new MimePartCountRule(nestedPackagePath, expectNumAttachments, true, "checkAttachmentNumber" + getNestedMimePackagePathDescription(nestedPackagePath), true);
rootRule.addRule(attachmentCountRule);
}
use of com.axway.ats.rbv.imap.rules.MimePartCountRule in project ats-framework by Axway.
the class Test_MimePartCountRule method isMatchWrongMetaData.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchWrongMetaData() throws RbvException {
MimePartCountRule rule = new MimePartCountRule(5, true, "isMatchEmptyMetaData", true);
metaData = new MetaData();
assertFalse(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.MimePartCountRule in project ats-framework by Axway.
the class Test_MimePartCountRule method matchRegularMimePartsCountPositive.
@Test
public void matchRegularMimePartsCountPositive() throws RbvException {
MimePartCountRule rule = new MimePartCountRule(2, false, "matchRegularMimePartsCountPositive", true);
assertTrue(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.MimePartCountRule in project ats-framework by Axway.
the class Test_MimePartCountRule method matchRegularMimePartsCountNegative.
@Test
public void matchRegularMimePartsCountNegative() throws RbvException {
MimePartCountRule rule = new MimePartCountRule(1, false, "matchRegularMimePartsCountNegative", true);
assertFalse(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.MimePartCountRule in project ats-framework by Axway.
the class Test_MimePartCountRule method matchAttachmentsCountPositive.
@Test
public void matchAttachmentsCountPositive() throws RbvException {
MimePartCountRule rule = new MimePartCountRule(1, true, "matchAttachmentsCountPositive", true);
assertTrue(rule.isMatch(metaData));
}
Aggregations