Search in sources :

Example 6 with HeaderRule

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

the class Test_HeaderRule method isMatchModeRegexThirdHeaderNegative.

@Test
public void isMatchModeRegexThirdHeaderNegative() throws RbvException {
    HeaderRule rule = new HeaderRule("Content-Type", "asdf.*", 1, 0, HeaderMatchMode.REGEX, "isMatchModeRegexThirdHeaderNegative", 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 7 with HeaderRule

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

the class Test_HeaderRule method isMatchModeLeftThirdHeaderNegative.

@Test
public void isMatchModeLeftThirdHeaderNegative() throws RbvException {
    HeaderRule rule = new HeaderRule("Content-Type", "asdf", 1, 0, HeaderMatchMode.LEFT, "isMatchModeLeftThirdHeaderNegative", 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 8 with HeaderRule

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

the class Test_HeaderRule method isMatchModeLeftNegative.

@Test
public void isMatchModeLeftNegative() throws RbvException {
    HeaderRule rule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.LEFT, "isMatchModeLeftNegative", 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 9 with HeaderRule

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

the class Test_HeaderRule method isMatchModeLeftPositive.

@Test
public void isMatchModeLeftPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Sender", "infos1.mercatoloterie", HeaderMatchMode.LEFT, "isMatchModeLeftPositive", 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 10 with HeaderRule

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

the class Test_HeaderRule method setExpectedValue.

@Test
public void setExpectedValue() throws RbvException {
    HeaderRule rule = new HeaderRule("Sender", "", HeaderMatchMode.FIND, "setExpectedValue", true);
    //positive
    rule.setExpectedValue("infos1.mercatoloterie@gmail.com");
    assertTrue(rule.isMatch(metaData));
    //negative
    rule.setExpectedValue("werqwer@gmail.com");
    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