Search in sources :

Example 26 with HeaderRule

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

the class Test_HeaderRule method isMatchModeLeftThirdHeaderPositive.

@Test
public void isMatchModeLeftThirdHeaderPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Received", "(qmail 20592", 2, HeaderMatchMode.LEFT, "isMatchModeLeftThirdHeaderPositive", 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 27 with HeaderRule

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

the class Test_HeaderRule method isMatchHeaderValueAtAnyPositionNegative.

@Test
public void isMatchHeaderValueAtAnyPositionNegative() throws RbvException, PackageException, FileNotFoundException {
    HeaderRule rule = new HeaderRule("Test-Header", "some value4", HeaderMatchMode.EQUALS, "isMatchHeaderValueAtAnyPositionNegative", 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 28 with HeaderRule

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

the class Test_HeaderRule method isMatchModeFindThirdHeaderPositive.

@Test
public void isMatchModeFindThirdHeaderPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Received", "invoked from network", 2, HeaderMatchMode.FIND, "isMatchModeFindThirdHeaderPositive", true);
    //the whole string
    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 29 with HeaderRule

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

the class Test_HeaderRule method isMatchModeRegexSecondMimePartNegative.

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

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

the class Test_HeaderRule method isMatchModeLeftSecondMimePartNegative.

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