Search in sources :

Example 1 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 2 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 3 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)

Example 4 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 5 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)

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