use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFieldsTest method testEnabledFields.
@Test
public void testEnabledFields() {
QueryParameters query = QueryParameters.query("fields=username,firstname,lastname").enableFields(true).build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFields());
Assert.assertEquals(3, query.getFields().size());
Assert.assertEquals("username", query.getFields().get(0));
Assert.assertEquals("firstname", query.getFields().get(1));
Assert.assertEquals("lastname", query.getFields().get(2));
query = QueryParameters.query("fields=username,firstname,lastname").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFields());
Assert.assertEquals(3, query.getFields().size());
Assert.assertEquals("username", query.getFields().get(0));
Assert.assertEquals("firstname", query.getFields().get(1));
Assert.assertEquals("lastname", query.getFields().get(2));
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFieldsTest method testQueryFieldsObject.
@Test
public void testQueryFieldsObject() {
QueryParameters query = new QueryParameters();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFields());
Assert.assertEquals(0, query.getFields().size());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFieldsTest method testDuplicateFields.
@Test
public void testDuplicateFields() {
QueryParameters query = QueryParameters.query("select=country,firstname,country").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFields());
Assert.assertEquals(2, query.getFields().size());
Assert.assertEquals("country", query.getFields().get(0));
Assert.assertEquals("firstname", query.getFields().get(1));
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFieldsTest method testDisabledFields.
@Test
public void testDisabledFields() {
QueryParameters query = QueryParameters.query("fields=username,firstname,lastname").enableFields(false).build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFields());
Assert.assertEquals(0, query.getFields().size());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFieldsTest method testEmptyField.
@Test
public void testEmptyField() {
QueryParameters query = QueryParameters.query("fields=").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFields());
Assert.assertEquals(0, query.getFields().size());
}
Aggregations