Search in sources :

Example 41 with HeaderRule

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

the class Test_HeaderRule method isMatchModeRegexSecondMimePartPositive.

@Test
public void isMatchModeRegexSecondMimePartPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Content-Type", "text.*", 1, 0, HeaderMatchMode.REGEX, "isMatchModeRegexSecondMimePartPositive", true);
    assertTrue(rule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 42 with HeaderRule

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

the class Test_HeaderRule method isMatchModeFindThirdHeaderNegative.

@Test
public void isMatchModeFindThirdHeaderNegative() throws RbvException {
    HeaderRule rule = new HeaderRule("Content-Type", "asdf", 1, 0, HeaderMatchMode.FIND, "isMatchModeFindThirdHeaderNegative", true);
    assertFalse(rule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 43 with HeaderRule

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

the class Test_HeaderRule method isMatchModeFindPositive.

@Test
public void isMatchModeFindPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Sender", "infos1.mercatoloterie@gmail.com", HeaderMatchMode.FIND, "isMatchModeFindPositive", true);
    //the whole string
    assertTrue(rule.isMatch(metaData));
    //part of the string
    rule.setExpectedValue("gmail.com");
    assertTrue(rule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 44 with HeaderRule

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

the class Test_HeaderRule method isMatchNoSuchHeader.

@Test
public void isMatchNoSuchHeader() throws RbvException {
    HeaderRule rule = new HeaderRule("Sender123", "infos1.mercatoloterie@gmail.com", HeaderMatchMode.FIND, "isMatchNoSuchHeader", true);
    assertFalse(rule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 45 with HeaderRule

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

the class Test_HeaderRule method isMatchModeRegexNegative.

@Test
public void isMatchModeRegexNegative() throws RbvException {
    HeaderRule rule = new HeaderRule("Sender", "infos1.mercatoloterie.?gmail.com.+", HeaderMatchMode.REGEX, "isMatchModeRegexNegative", true);
    assertFalse(rule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

HeaderRule (com.axway.ats.rbv.imap.rules.HeaderRule)45 BaseTest (com.axway.ats.rbv.BaseTest)43 Test (org.junit.Test)43 AndRuleOperation (com.axway.ats.rbv.rules.AndRuleOperation)4 OrRuleOperation (com.axway.ats.rbv.rules.OrRuleOperation)4 PublicAtsApi (com.axway.ats.common.PublicAtsApi)2 ImapMetaData (com.axway.ats.rbv.imap.ImapMetaData)2 MetaData (com.axway.ats.rbv.MetaData)1