use of org.xwiki.notifications.filters.expression.NotNode in project xwiki-platform by xwiki.
the class ExpressionNodeToHQLConverterTest method parseWithNotNode.
@Test
public void parseWithNotNode() {
AbstractNode testAST = new NotNode(new EqualsNode(new StringValueNode(TEST_VALUE_1), new StringValueNode(TEST_VALUE_2)));
assertEquals(String.format(" NOT (:%s = :%s)", TEST_VALUE_1_IDENTIFIER, TEST_VALUE_2_IDENTIFIER), parser.parse(testAST).getQuery());
}
use of org.xwiki.notifications.filters.expression.NotNode in project xwiki-platform by xwiki.
the class ExpressionNodeToHQLConverterTest method parseWithInListOfReadEventsNode.
@Test
public void parseWithInListOfReadEventsNode() {
DocumentReference user = new DocumentReference("xwiki", "XWiki", "userA");
when(serializer.serialize(user)).thenReturn("xwiki:XWiki.UserA");
AbstractNode testAST = new NotNode(new InListOfReadEventsNode(user));
ExpressionNodeToHQLConverter.HQLQuery result = parser.parse(testAST);
assertEquals(" NOT (" + "event IN (select status.activityEvent from ActivityEventStatusImpl status " + "where status.activityEvent = event and status.entityId = :userStatusRead " + "and status.read = true))", result.getQuery());
assertEquals("xwiki:XWiki.UserA", result.getQueryParameters().get("userStatusRead"));
}
Aggregations