use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class Test_StringInMimePartRule method isMatchEmptyMetaData.
@Test(expected = MetaDataIncorrectException.class)
public void isMatchEmptyMetaData() throws RbvException {
StringInMimePartRule rule = new StringInMimePartRule("US AIR FORCE", false, 2, false, "isMatchEmptyMetaData", false);
metaData = new ImapMetaData(null);
assertFalse(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class Test_StringInMimePartRule method isMatchRegexRegularPartPositive.
@Test
public void isMatchRegexRegularPartPositive() throws RbvException {
//expected true
StringInMimePartRule rule = new StringInMimePartRule("US .* FORCE", true, 2, false, "isMatchRegexRegularPartPositive1", true);
assertTrue(rule.isMatch(metaData));
//expected false
rule = new StringInMimePartRule("US .? FORCE", true, 2, false, "isMatchRegexRegularPartPositive2", false);
assertTrue(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class ImapVerification method checkRegexInAttachment.
/**
* Check that the nested IMAP message contains the specified regular expression in the given attachment part
*
* @param searchRegex the regular expression to search for
* @param attachmentIndex the index of the attachment in the MIME structure (regular parts are skipped)
* @param nestedPackagePath path to the nested message
*/
@PublicAtsApi
public void checkRegexInAttachment(String searchRegex, int attachmentIndex, int... nestedPackagePath) {
//create the rule
StringInMimePartRule stringInPartRule = new StringInMimePartRule(nestedPackagePath, searchRegex, true, attachmentIndex, true, "checkRegexgInAttachment" + getNestedMimePackagePathDescription(nestedPackagePath), true);
rootRule.addRule(stringInPartRule);
}
use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class ImapVerification method checkStringInRegularBodyPart.
/**
* Check that the nested IMAP message contains the specified string in the given regular body part
*
* @param searchString the string to search for
* @param partIndex the index of the regular part in the MIME structure (attachments are skipped)
* @param nestedPackagePath path to the nested message
*/
@PublicAtsApi
public void checkStringInRegularBodyPart(String searchString, int partIndex, int... nestedPackagePath) {
//create the rule
StringInMimePartRule stringInPartRule = new StringInMimePartRule(nestedPackagePath, searchString, false, partIndex, false, "checkStringInRegularBodyPart" + getNestedMimePackagePathDescription(nestedPackagePath), true);
rootRule.addRule(stringInPartRule);
}
use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class ImapVerification method checkBody.
/**
* Check that the body of the nested message (including all parts) contains the specified string
*
* @param body the string to search for
* @param nestedPackagePath path to the nested message
*/
@PublicAtsApi
public void checkBody(String body, int... nestedPackagePath) {
//create the rule
StringInMimePartRule stringInPartRule = new StringInMimePartRule(nestedPackagePath, body, false, "checkBody" + getNestedMimePackagePathDescription(nestedPackagePath), true);
rootRule.addRule(stringInPartRule);
}
Aggregations