Search in sources :

Example 21 with HeaderRule

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

the class Test_AndRuleOperation method isMatchOneOfThRulesExpectedFalsePositive.

@Test
public void isMatchOneOfThRulesExpectedFalsePositive() throws RbvException {
    HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalsePositive", true);
    HeaderRule secondRule = new HeaderRule("Sender", "gmail123.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalsePositive", false);
    AndRuleOperation andRule = new AndRuleOperation();
    andRule.addRule(firstRule);
    andRule.addRule(secondRule);
    assertTrue(andRule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) AndRuleOperation(com.axway.ats.rbv.rules.AndRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 22 with HeaderRule

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

the class Test_AndRuleOperation method isMatchOneOfThRulesExpectedFalseNegative.

@Test
public void isMatchOneOfThRulesExpectedFalseNegative() throws RbvException {
    HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalseNegative", true);
    HeaderRule secondRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalseNegative", false);
    AndRuleOperation andRule = new AndRuleOperation();
    andRule.addRule(firstRule);
    andRule.addRule(secondRule);
    assertFalse(andRule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) AndRuleOperation(com.axway.ats.rbv.rules.AndRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 23 with HeaderRule

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

the class Test_OrRuleOperation method isMatchNoneOfTheRulesPasses.

@Test
public void isMatchNoneOfTheRulesPasses() throws RbvException {
    HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchNoneOfTheRulesPasses1", false);
    HeaderRule secondRule = new HeaderRule("Sender", "gmail123.com", HeaderMatchMode.FIND, "isMatchNoneOfTheRulesPasses2", true);
    OrRuleOperation andRule = new OrRuleOperation();
    andRule.addRule(firstRule);
    andRule.addRule(secondRule);
    assertFalse(andRule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) OrRuleOperation(com.axway.ats.rbv.rules.OrRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 24 with HeaderRule

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

the class Test_OrRuleOperation method isMatchOnlyOneRulePasses.

@Test
public void isMatchOnlyOneRulePasses() throws RbvException {
    HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchOnlyOneRulePasses1", true);
    HeaderRule secondRule = new HeaderRule("Sender", "gmail123.com", HeaderMatchMode.FIND, "isMatchOnlyOneRulePasses2", true);
    OrRuleOperation andRule = new OrRuleOperation();
    andRule.addRule(firstRule);
    andRule.addRule(secondRule);
    assertTrue(andRule.isMatch(metaData));
}
Also used : HeaderRule(com.axway.ats.rbv.imap.rules.HeaderRule) OrRuleOperation(com.axway.ats.rbv.rules.OrRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 25 with HeaderRule

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

the class Test_HeaderRule method isMatchModeRightThirdHeaderPositive.

@Test
public void isMatchModeRightThirdHeaderPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Received", "14:33:17 -0000", 2, HeaderMatchMode.RIGHT, "isMatchModeRightThirdHeaderPositive", 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)

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