use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFiltersTest method testQueryEncodedNull.
@Test
public void testQueryEncodedNull() {
QueryParameters query = QueryParameters.queryEncoded(null).build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFilters());
Assert.assertEquals(0, query.getFilters().size());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFiltersTest method testQueryFieldsObject.
@Test
public void testQueryFieldsObject() {
QueryParameters query = new QueryParameters();
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 QueryStringBuilderFiltersTest method testInFilter.
@Test
public void testInFilter() {
QueryParameters query = QueryParameters.query("where=username:in:[johnf,garryz]").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFilters());
Assert.assertEquals(1, query.getFilters().size());
Assert.assertEquals("username", query.getFilters().get(0).getField());
Assert.assertNotNull(query.getFilters().get(0).getOperation());
Assert.assertEquals(FilterOperation.IN, query.getFilters().get(0).getOperation());
Assert.assertNull(query.getFilters().get(0).getValue());
Assert.assertEquals(2, query.getFilters().get(0).getValues().size());
Assert.assertEquals("johnf", query.getFilters().get(0).getValues().get(0));
Assert.assertEquals("garryz", query.getFilters().get(0).getValues().get(1));
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFiltersTest method testMultipleFilters.
@Test
public void testMultipleFilters() {
QueryParameters query = QueryParameters.query("where=username:eq:'test test' lastname:gte:gale").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFilters());
Assert.assertEquals(2, query.getFilters().size());
Assert.assertEquals("username", query.getFilters().get(0).getField());
Assert.assertNotNull(query.getFilters().get(0).getOperation());
Assert.assertEquals(FilterOperation.EQ, query.getFilters().get(0).getOperation());
Assert.assertEquals("test test", query.getFilters().get(0).getValue());
Assert.assertEquals("lastname", query.getFilters().get(1).getField());
Assert.assertNotNull(query.getFilters().get(1).getOperation());
Assert.assertEquals(FilterOperation.GTE, query.getFilters().get(1).getOperation());
Assert.assertEquals("gale", query.getFilters().get(1).getValue());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderFiltersTest method testNoDateIdentifier.
@Test
public void testNoDateIdentifier() {
QueryParameters query = QueryParameters.query("where=username:gte:'2014-11-26T11:15:08Z'").build();
Assert.assertNotNull(query);
Assert.assertNotNull(query.getFilters());
Assert.assertEquals(1, query.getFilters().size());
Assert.assertEquals("username", query.getFilters().get(0).getField());
Assert.assertNotNull(query.getFilters().get(0).getOperation());
Assert.assertEquals(FilterOperation.GTE, query.getFilters().get(0).getOperation());
Assert.assertEquals("2014-11-26T11:15:08Z", query.getFilters().get(0).getValue());
}
Aggregations