Search in sources :

Example 6 with QueryStringDefaults

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());
}
Also used : QueryStringDefaults(com.github.tfaga.lynx.utils.QueryStringDefaults) QueryParameters(com.github.tfaga.lynx.beans.QueryParameters) Test(org.junit.Test)

Example 7 with QueryStringDefaults

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());
}
Also used : QueryStringDefaults(com.github.tfaga.lynx.utils.QueryStringDefaults) QueryParameters(com.github.tfaga.lynx.beans.QueryParameters) Test(org.junit.Test)

Example 8 with QueryStringDefaults

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());
}
Also used : QueryStringDefaults(com.github.tfaga.lynx.utils.QueryStringDefaults) QueryParameters(com.github.tfaga.lynx.beans.QueryParameters) Test(org.junit.Test)

Example 9 with QueryStringDefaults

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());
}
Also used : QueryStringDefaults(com.github.tfaga.lynx.utils.QueryStringDefaults) QueryParameters(com.github.tfaga.lynx.beans.QueryParameters) Test(org.junit.Test)

Example 10 with QueryStringDefaults

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());
}
Also used : QueryStringDefaults(com.github.tfaga.lynx.utils.QueryStringDefaults) QueryParameters(com.github.tfaga.lynx.beans.QueryParameters) Test(org.junit.Test)

Aggregations

QueryParameters (com.github.tfaga.lynx.beans.QueryParameters)14 QueryStringDefaults (com.github.tfaga.lynx.utils.QueryStringDefaults)14 Test (org.junit.Test)14