use of org.jaffa.rules.testmodels.UserCriteria in project jaffa-framework by jaffa-projects.
the class GraphCriteriaFlexFieldsTest method testHasFlexFields.
public void testHasFlexFields() throws FrameworkException, ApplicationExceptions {
UserCriteria userCriteria = new UserCriteria();
StaticContext.initialize(userCriteria);
assertNotNull(userCriteria.getFlexCriteriaBean());
}
use of org.jaffa.rules.testmodels.UserCriteria in project jaffa-framework by jaffa-projects.
the class GraphCriteriaFlexFieldsTest method testCriteriaClauseDomainMapped.
public void testCriteriaClauseDomainMapped() throws FrameworkException, ApplicationExceptions {
UserCriteria userCriteria = new UserCriteria();
StaticContext.initialize(userCriteria);
assertNotNull(userCriteria.getFlexCriteriaBean());
Criteria c = userCriteria.buildQueryCriteria();
assertNull(c.getCriteriaEntries());
userCriteria.getFlexCriteriaBean().set("remarks", new StringCriteriaField("Equals", "nice guy"));
c = userCriteria.buildQueryCriteria();
assertNotNull(c.getCriteriaEntries());
assertEquals(1, c.getCriteriaEntries().size());
List<Criteria.CriteriaEntry> criteriaEntries = new ArrayList<>(c.getCriteriaEntries());
assertEquals("nice guy", criteriaEntries.get(0).getValue());
assertEquals("UserRef15", criteriaEntries.get(0).getName());
}
Aggregations