use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.
the class ImapVerification method checkSubject.
/**
* Check that the subject of the nested message contains the specified string
*
* @param subject the string to search for
* @param searchWhere type of matching to use
* @param nestedPackagePath path to the nested message
*/
@PublicAtsApi
public void checkSubject(String subject, SubjectMatchMode searchWhere, int... nestedPackagePath) {
//create the rule
SubjectRule subjectRule = new SubjectRule(nestedPackagePath, subject, searchWhere, "checkSubject" + getNestedMimePackagePathDescription(nestedPackagePath), true);
rootRule.addRule(subjectRule);
}
use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.
the class Test_SubjectRule method isMatchModeLeftPositive.
@Test
public void isMatchModeLeftPositive() throws RbvException {
SubjectRule rule = new SubjectRule("LOTERIE", SubjectMatchMode.LEFT, "isMatchModeLeftPositive", true);
assertTrue(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.
the class Test_SubjectRule method isMatchModeRegexPositive.
@Test
public void isMatchModeRegexPositive() throws RbvException {
SubjectRule rule = new SubjectRule(".*MONDIALE.", SubjectMatchMode.REGEX, "isMatchModeRegexPositive", true);
assertTrue(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.
the class Test_SubjectRule method isMatchModeFindNegative.
@Test
public void isMatchModeFindNegative() throws RbvException {
SubjectRule rule = new SubjectRule("MONDIALE.123", SubjectMatchMode.FIND, "isMatchModeFindNegative", true);
assertFalse(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.
the class Test_SubjectRule method isMatchModeFindPositive.
@Test
public void isMatchModeFindPositive() throws RbvException {
SubjectRule rule = new SubjectRule("LOTERIE MONDIALE.", SubjectMatchMode.FIND, "isMatchModeFindPositive", true);
//the whole string
assertTrue(rule.isMatch(metaData));
//part of the string
rule = new SubjectRule("LOTERIE", SubjectMatchMode.FIND, "isMatchModeFindPositive", true);
assertTrue(rule.isMatch(metaData));
}
Aggregations