@Test public void testGreaterThanEqual() { Criteria criteria = new Criteria("field_1").greaterThanEqual(100); CriteriaEntry entry = getCriteriaEntryByPosition(criteria.getCriteriaEntries(), 0); Assert.assertEquals(OperationKey.BETWEEN.getKey(), entry.getKey()); Assert.assertEquals(100, ((Object[]) entry.getValue())[0]); Assert.assertEquals(null, ((Object[]) entry.getValue())[1]); Assert.assertTrue(((Boolean) ((Object[]) entry.getValue())[2]).booleanValue()); Assert.assertTrue(((Boolean) ((Object[]) entry.getValue())[3]).booleanValue()); }
@Test public void testBetweenExcludingUpperBound() { Criteria criteria = new Criteria("field_1").between(100, 200, true, false); CriteriaEntry entry = getCriteriaEntryByPosition(criteria.getCriteriaEntries(), 0); Assert.assertEquals(OperationKey.BETWEEN.getKey(), entry.getKey()); Assert.assertEquals(100, ((Object[]) entry.getValue())[0]); Assert.assertEquals(200, ((Object[]) entry.getValue())[1]); Assert.assertTrue(((Boolean) ((Object[]) entry.getValue())[2]).booleanValue()); Assert.assertFalse(((Boolean) ((Object[]) entry.getValue())[3]).booleanValue()); }