use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFieldsTest method testEmptyFields.
@Test
public void testEmptyFields() {
QueryParameters query = QueryParameters.query("select=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 testMultipleFieldKeys.
@Test
public void testMultipleFieldKeys() {
QueryParameters query = QueryParameters.query("select=username,firstname," + "lastname&fields=address").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFields());
Assert.assertEquals(1, query.getFields().size());
Assert.assertEquals("address", query.getFields().get(0));
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFieldsTest method testMultipleFields.
@Test
public void testMultipleFields() {
QueryParameters 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 QueryStringBuilderFiltersTest method testQuotesInInicFilter.
@Test
public void testQuotesInInicFilter() {
QueryParameters query = QueryParameters.query("where=country:inic:['Czech Republic',China,'United States']").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFilters());
Assert.assertEquals(1, query.getFilters().size());
Assert.assertEquals("country", query.getFilters().get(0).getField());
Assert.assertNotNull(query.getFilters().get(0).getOperation());
Assert.assertEquals(FilterOperation.INIC, query.getFilters().get(0).getOperation());
Assert.assertNull(query.getFilters().get(0).getValue());
Assert.assertEquals(3, query.getFilters().get(0).getValues().size());
Assert.assertEquals("Czech Republic", query.getFilters().get(0).getValues().get(0));
Assert.assertEquals("China", query.getFilters().get(0).getValues().get(1));
Assert.assertEquals("United States", query.getFilters().get(0).getValues().get(2));
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFiltersTest method testEmptyFilter.
@Test
public void testEmptyFilter() {
QueryParameters query = QueryParameters.query("filter=").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFilters());
Assert.assertEquals(0, query.getFilters().size());
}
Aggregations