use of com.axway.ats.rbv.imap.rules.HeaderRule in project ats-framework by Axway.
the class Test_OrRuleOperation method isMatchBothRulesExpectedTrue.
@Test
public void isMatchBothRulesExpectedTrue() throws RbvException {
HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTrue1", true);
HeaderRule secondRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTrue2", true);
OrRuleOperation andRule = new OrRuleOperation();
andRule.addRule(firstRule);
andRule.addRule(secondRule);
assertTrue(andRule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.HeaderRule in project ats-framework by Axway.
the class ImapVerification method checkHeader.
/**
* Check that the nested message contains a header with the specified value
* in one of its MIME parts
*
* @param headerName the name of the header
* @param headerValue the value to search for
* @param partIndex the MIME part index
* @param searchWhere type of matching to use
* @param nestedPackagePath path to the nested message
*/
@PublicAtsApi
public void checkHeader(String headerName, String headerValue, int partIndex, HeaderMatchMode searchWhere, int... nestedPackagePath) {
//create the rule
HeaderRule stringInPartRule = new HeaderRule(nestedPackagePath, headerName, headerValue, partIndex, -1, searchWhere, "checkHeader" + getNestedMimePackagePathDescription(nestedPackagePath), true);
rootRule.addRule(stringInPartRule);
}
use of com.axway.ats.rbv.imap.rules.HeaderRule in project ats-framework by Axway.
the class ImapVerification method checkHeaderForMessageTag.
/**
* Check that the nested message is tagged with the specified message tag
*
* @param messageTag
* @param nestedPackagePath path to the nested message
*/
@PublicAtsApi
public void checkHeaderForMessageTag(String messageTag, int... nestedPackagePath) {
//create the rule
//set this rule with highest priority, so it is evaluated first
HeaderRule stringInPartRule = new HeaderRule(nestedPackagePath, "Automation-Message-Tag", messageTag, HeaderMatchMode.FIND, "checkMessageTagHeader" + getNestedMimePackagePathDescription(nestedPackagePath), true, Integer.MIN_VALUE);
rootRule.addRule(stringInPartRule);
}
use of com.axway.ats.rbv.imap.rules.HeaderRule in project ats-framework by Axway.
the class Test_AndRuleOperation method isMatchBothRulesExpectedTrueNegative.
@Test
public void isMatchBothRulesExpectedTrueNegative() throws RbvException {
HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTrueNegative", true);
HeaderRule secondRule = new HeaderRule("Sender", "gmail123.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTrueNegative", true);
firstRule.equals(secondRule);
AndRuleOperation andRule = new AndRuleOperation();
andRule.addRule(firstRule);
andRule.addRule(secondRule);
assertFalse(andRule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.HeaderRule in project ats-framework by Axway.
the class Test_AndRuleOperation method isMatchBothRulesExpectedTruePositive.
@Test
public void isMatchBothRulesExpectedTruePositive() throws RbvException {
HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTruePositive", true);
HeaderRule secondRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTruePositive", true);
AndRuleOperation andRule = new AndRuleOperation();
andRule.addRule(firstRule);
andRule.addRule(secondRule);
assertTrue(andRule.isMatch(metaData));
}
Aggregations