Search in sources :

Example 36 with HeaderRule

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

the class Test_HeaderRule method isMatchModeRegexThirdHeaderPositive.

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

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

the class Test_HeaderRule method isMatchPartHeaderValueAtAnyPosition.

@Test
public void isMatchPartHeaderValueAtAnyPosition() throws RbvException, PackageException, FileNotFoundException {
    HeaderRule rule;
    rule = new HeaderRule("Test-Part-Header", "some part value1", 0, -1, HeaderMatchMode.EQUALS, "isMatchPartHeaderValueAtAnyPosition", true);
    assertTrue(rule.isMatch(metaData));
    rule = new HeaderRule("Test-Part-Header", "some part value2", 0, -1, HeaderMatchMode.EQUALS, "isMatchPartHeaderValueAtAnyPosition", true);
    assertTrue(rule.isMatch(metaData));
    rule = new HeaderRule("Test-Part-Header", "some part value3", 0, -1, HeaderMatchMode.EQUALS, "isMatchPartHeaderValueAtAnyPosition", 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 38 with HeaderRule

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

the class Test_HeaderRule method isMatchModeLeftSecondMimePartPositive.

@Test
public void isMatchModeLeftSecondMimePartPositive() throws RbvException {
    HeaderRule rule = new HeaderRule("Content-Type", "text/html", 1, 0, HeaderMatchMode.LEFT, "isMatchModeLeftSecondMimePartPositive", 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 39 with HeaderRule

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

the class Test_HeaderRule method isMatchModeRightSecondMimePartNegative.

@Test
public void isMatchModeRightSecondMimePartNegative() throws RbvException {
    HeaderRule rule = new HeaderRule("Content-Type", "text", 1, 0, HeaderMatchMode.RIGHT, "isMatchModeRightSecondMimePartNegative", 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 40 with HeaderRule

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

the class Test_HeaderRule method isMatchPartHeaderValueAtAnyPositionNegative.

@Test
public void isMatchPartHeaderValueAtAnyPositionNegative() throws RbvException, PackageException, FileNotFoundException {
    HeaderRule rule = new HeaderRule("Test-Part-Header", "some part value4", 0, -1, HeaderMatchMode.EQUALS, "isMatchPartHeaderValueAtAnyPositionNegative", 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