use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFiltersTest method testQueryEncoded.
@Test
public void testQueryEncoded() {
QueryParameters query = QueryParameters.queryEncoded("where=firstname:like:Kar%25").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFilters());
Assert.assertEquals(1, query.getFilters().size());
Assert.assertEquals("firstname", query.getFilters().get(0).getField());
Assert.assertNotNull(query.getFilters().get(0).getOperation());
Assert.assertEquals(FilterOperation.LIKE, query.getFilters().get(0).getOperation());
Assert.assertEquals("Kar%", query.getFilters().get(0).getValue());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderOrderTest method testEmptyOrder.
@Test
public void testEmptyOrder() {
QueryParameters query = QueryParameters.query("order=").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getOrder());
Assert.assertEquals(0, query.getOrder().size());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderOrderTest method testMultipleOrders.
@Test
public void testMultipleOrders() {
QueryParameters query = QueryParameters.query("order=username ASC,lastname DESC").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getOrder());
Assert.assertEquals(2, query.getOrder().size());
Assert.assertEquals("username", query.getOrder().get(0).getField());
Assert.assertNotNull(query.getOrder().get(0).getOrder());
Assert.assertEquals(OrderDirection.ASC, query.getOrder().get(0).getOrder());
Assert.assertEquals("lastname", query.getOrder().get(1).getField());
Assert.assertNotNull(query.getOrder().get(1).getOrder());
Assert.assertEquals(OrderDirection.DESC, query.getOrder().get(1).getOrder());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderOrderTest method testQueryOrderObject.
@Test
public void testQueryOrderObject() {
QueryParameters query = new QueryParameters();
Assert.assertNotNull(query.getOrder());
Assert.assertEquals(0, query.getOrder().size());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderOrderTest method testMultipleOrderKeys.
@Test
public void testMultipleOrderKeys() {
QueryParameters query = QueryParameters.query("order=username,firstname&sort=lastname DESC").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getOrder());
Assert.assertEquals(1, query.getOrder().size());
Assert.assertEquals("lastname", query.getOrder().get(0).getField());
Assert.assertNotNull(query.getOrder().get(0).getOrder());
Assert.assertEquals(OrderDirection.DESC, query.getOrder().get(0).getOrder());
}
Aggregations