Search in sources :

Example 6 with SubjectRule

use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.

the class Test_SubjectRule method isMatchNullMetaData.

@Test(expected = RbvException.class)
public void isMatchNullMetaData() throws RbvException {
    SubjectRule rule = new SubjectRule("infos1.mercatoloterie@gmail.com", SubjectMatchMode.FIND, "isMatchNullMetaData", true);
    assertFalse(rule.isMatch(null));
}
Also used : SubjectRule(com.axway.ats.rbv.imap.rules.SubjectRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 7 with SubjectRule

use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.

the class Test_SubjectRule method isMatchEmptyMetaData.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchEmptyMetaData() throws RbvException {
    SubjectRule rule = new SubjectRule("infos1.mercatoloterie@gmail.com", SubjectMatchMode.FIND, "isMatchEmptyMetaData", true);
    metaData = new ImapMetaData(null);
    assertFalse(rule.isMatch(metaData));
}
Also used : ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) SubjectRule(com.axway.ats.rbv.imap.rules.SubjectRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 8 with SubjectRule

use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.

the class Test_SubjectRule method isMatchModeEqualsNegative.

@Test
public void isMatchModeEqualsNegative() throws RbvException {
    SubjectRule rule = new SubjectRule("MONDIALE.", SubjectMatchMode.EQUALS, "isMatchModeEqualsNegative", 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 9 with SubjectRule

use of com.axway.ats.rbv.imap.rules.SubjectRule in project ats-framework by Axway.

the class Test_SubjectRule method isMatchModeRightNegative.

@Test
public void isMatchModeRightNegative() throws RbvException {
    SubjectRule rule = new SubjectRule("MONDIALE", SubjectMatchMode.RIGHT, "isMatchModeRightNegative", 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 10 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 has the specified string
     *
     * @param subject       the expected subject
     * @param nestedPackagePath path to the nested message
     */
@PublicAtsApi
public void checkSubject(String subject, int... nestedPackagePath) {
    //create the rule
    SubjectRule subjectRule = new SubjectRule(nestedPackagePath, subject, SubjectMatchMode.EQUALS, "checkSubject" + getNestedMimePackagePathDescription(nestedPackagePath), true);
    rootRule.addRule(subjectRule);
}
Also used : SubjectRule(com.axway.ats.rbv.imap.rules.SubjectRule) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

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