Search in sources :

Example 1 with MimePartCountRule

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);
}
Also used : MimePartCountRule(com.axway.ats.rbv.imap.rules.MimePartCountRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 2 with MimePartCountRule

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));
}
Also used : ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) MetaData(com.axway.ats.rbv.MetaData) MimePartCountRule(com.axway.ats.rbv.imap.rules.MimePartCountRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 3 with MimePartCountRule

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));
}
Also used : MimePartCountRule(com.axway.ats.rbv.imap.rules.MimePartCountRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 4 with MimePartCountRule

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));
}
Also used : MimePartCountRule(com.axway.ats.rbv.imap.rules.MimePartCountRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 5 with MimePartCountRule

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));
}
Also used : MimePartCountRule(com.axway.ats.rbv.imap.rules.MimePartCountRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

MimePartCountRule (com.axway.ats.rbv.imap.rules.MimePartCountRule)8 BaseTest (com.axway.ats.rbv.BaseTest)7 Test (org.junit.Test)7 ImapMetaData (com.axway.ats.rbv.imap.ImapMetaData)2 PublicAtsApi (com.axway.ats.common.PublicAtsApi)1 MetaData (com.axway.ats.rbv.MetaData)1