Search in sources :

Example 1 with EntityReferenceNode

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

the class ExpressionNodeToHQLConverterTest method parseEntityReferenceNode.

@Test
public void parseEntityReferenceNode() {
    DocumentReference documentReference = new DocumentReference("xwiki", "Main", "WebHome");
    when(serializer.serialize(documentReference)).thenReturn("xwiki:Main.WebHome");
    AbstractNode testAST = new EntityReferenceNode(documentReference);
    ExpressionNodeToHQLConverter.HQLQuery result = parser.parse(testAST);
    assertEquals(":entity_e9f8294b0de086574bed923c45695bc8afc27d3ede9c35ed44db8d2100929de4", result.getQuery());
    assertEquals("xwiki:Main.WebHome", result.getQueryParameters().get("entity_e9f8294b0de086574bed923c45695bc8afc27d3ede9c35ed44db8d2100929de4"));
}
Also used : AbstractNode(org.xwiki.notifications.filters.expression.generics.AbstractNode) EntityReferenceNode(org.xwiki.notifications.filters.expression.EntityReferenceNode) DocumentReference(org.xwiki.model.reference.DocumentReference) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DocumentReference (org.xwiki.model.reference.DocumentReference)1 EntityReferenceNode (org.xwiki.notifications.filters.expression.EntityReferenceNode)1 AbstractNode (org.xwiki.notifications.filters.expression.generics.AbstractNode)1