Search in sources :

Example 1 with SubjectRule

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

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

Example 3 with SubjectRule

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

Example 4 with SubjectRule

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

Example 5 with SubjectRule

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

Aggregations

SubjectRule (com.axway.ats.rbv.imap.rules.SubjectRule)15 BaseTest (com.axway.ats.rbv.BaseTest)13 Test (org.junit.Test)13 PublicAtsApi (com.axway.ats.common.PublicAtsApi)2 ImapMetaData (com.axway.ats.rbv.imap.ImapMetaData)2 MetaData (com.axway.ats.rbv.MetaData)1