Search in sources :

Example 1 with StartsWith

use of org.xwiki.notifications.filters.expression.StartsWith in project xwiki-platform by xwiki.

the class ExpressionNodeToHQLConverterTest method parseWithStartsWithNode.

@Test
public void parseWithStartsWithNode() {
    AbstractNode testAST = new StartsWith(new StringValueNode(TEST_VALUE_1), new StringValueNode(TEST_VALUE_2));
    assertEquals(String.format(":%s LIKE concat(:%s, '%%') ESCAPE '!'", TEST_VALUE_1_IDENTIFIER, TEST_VALUE_2_IDENTIFIER), parser.parse(testAST).getQuery());
}
Also used : AbstractNode(org.xwiki.notifications.filters.expression.generics.AbstractNode) StringValueNode(org.xwiki.notifications.filters.expression.StringValueNode) StartsWith(org.xwiki.notifications.filters.expression.StartsWith) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 StartsWith (org.xwiki.notifications.filters.expression.StartsWith)1 StringValueNode (org.xwiki.notifications.filters.expression.StringValueNode)1 AbstractNode (org.xwiki.notifications.filters.expression.generics.AbstractNode)1