use of com.github.tfaga.lynx.utils.QueryStringDefaults in project lynx by TFaga.
the class QueryStringDefaultsTest method testDisabledFields.
@Test
public void testDisabledFields() {
QueryParameters query = new QueryStringDefaults().enableFields(false).builder().query("fields=name,email").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFields());
Assert.assertEquals(0, query.getFields().size());
}
use of com.github.tfaga.lynx.utils.QueryStringDefaults in project lynx by TFaga.
the class QueryStringDefaultsTest method testMultipleDefaults.
@Test
public void testMultipleDefaults() {
QueryParameters query = new QueryStringDefaults().defaultLimit(200).defaultOffset(20).builder().query("").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getLimit());
Assert.assertNotNull(query.getOffset());
Assert.assertEquals(200, query.getLimit().longValue());
Assert.assertEquals(20, query.getOffset().longValue());
}
use of com.github.tfaga.lynx.utils.QueryStringDefaults in project lynx by TFaga.
the class QueryStringDefaultsTest method testDisabledFilters.
@Test
public void testDisabledFilters() {
QueryParameters query = new QueryStringDefaults().enableFilters(false).builder().query("where=name:eq:tilen").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFilters());
Assert.assertEquals(0, query.getFilters().size());
}
use of com.github.tfaga.lynx.utils.QueryStringDefaults in project lynx by TFaga.
the class QueryStringDefaultsTest method testDisabledOrder.
@Test
public void testDisabledOrder() {
QueryParameters query = new QueryStringDefaults().enableOrder(false).builder().query("order=name ASC").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getOrder());
Assert.assertEquals(0, query.getOrder().size());
}
use of com.github.tfaga.lynx.utils.QueryStringDefaults in project lynx by TFaga.
the class QueryStringDefaultsTest method testDefaultLimit.
@Test
public void testDefaultLimit() {
QueryParameters query = new QueryStringDefaults().defaultLimit(60).builder().query("").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getLimit());
Assert.assertEquals(60, query.getLimit().longValue());
}
Aggregations