Search in sources :

Example 11 with HeaderRule

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

the class Test_HeaderRule method isMatchModeFindSecondMimePartNegative.

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

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

the class Test_HeaderRule method isMatchModeRightSecondMimePartPositive.

@Test
public void isMatchModeRightSecondMimePartPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Content-Type", "charset=WINDOWS-1252", 1, 0, HeaderMatchMode.RIGHT, "isMatchModeRightSecondMimePartPositive", 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 13 with HeaderRule

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

the class Test_HeaderRule method isMatchModeEqualsPositive.

@Test
public void isMatchModeEqualsPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Sender", "infos1.mercatoloterie@gmail.com", HeaderMatchMode.EQUALS, "isMatchModeEqualsPositive", 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 14 with HeaderRule

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

the class Test_HeaderRule method isMatchWrongMetaData.

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

Example 15 with HeaderRule

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

the class Test_OrRuleOperation method isMatchOneOfThRulesExpectedFalse.

@Test
public void isMatchOneOfThRulesExpectedFalse() throws RbvException {
    HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalse1", true);
    HeaderRule secondRule = new HeaderRule("Sender", "gmail123.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalse2", false);
    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)

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