use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderPagingTest method testEmptyLimit.
@Test
public void testEmptyLimit() {
QueryParameters query = QueryParameters.query("limit=").build();
Assert.assertNotNull(query);
Assert.assertNull(query.getLimit());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderPagingTest method testLimitUriWithFragment.
@Test
public void testLimitUriWithFragment() {
QueryParameters query = QueryParameters.uri("api.github.com/tfaga/repos?limit=123#header1").build();
Assert.assertNotNull(query.getLimit());
Assert.assertEquals(123, query.getLimit().longValue());
query = QueryParameters.uri("api.github.com/tfaga/repos#header2?skip=98172").build();
Assert.assertNull(query.getLimit());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderPagingTest method testOffsetUri.
@Test
public void testOffsetUri() {
QueryParameters query = QueryParameters.uri("api.github.com/tfaga/repos?skip=98172").build();
Assert.assertNotNull(query.getOffset());
Assert.assertEquals(98172, query.getOffset().longValue());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderPagingTest method testMaxLimit.
@Test
public void testMaxLimit() {
QueryParameters query = QueryParameters.query("limit=321").maxLimit(200).build();
Assert.assertNotNull(query.getLimit());
Assert.assertEquals(200, query.getLimit().longValue());
}
use of com.github.tfaga.lynx.beans.QueryParameters in project lynx by TFaga.
the class QueryStringBuilderPagingTest method testOffset.
@Test
public void testOffset() {
QueryParameters query = QueryParameters.query("offset=921").build();
Assert.assertNotNull(query.getOffset());
Assert.assertEquals(921, query.getOffset().longValue());
query = QueryParameters.query("skip=824").build();
Assert.assertNotNull(query.getOffset());
Assert.assertEquals(824, query.getOffset().longValue());
}
Aggregations