use of org.summerb.easycrud.api.dto.PagerParams in project summerb by skarpushin.
the class GenericCrudServiceTestTemplate method testQuery_expectPaginationWorksCorrectly.
@Test
public void testQuery_expectPaginationWorksCorrectly() throws Exception {
createTestData();
PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 2), Query.n().contains("env", "env-"));
assertEquals(3, result.getTotalResults());
assertEquals(2, result.getItems().size());
}
use of org.summerb.easycrud.api.dto.PagerParams in project summerb by skarpushin.
the class GenericCrudServiceTestTemplate method testFindByQueryOr.
@Test
public void testFindByQueryOr() throws Exception {
createTestData();
PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().eq("majorVersion", 3L).or(Query.n().eq("minorVersion", 4L), Query.n().eq("minorVersion", 5L)));
assertEquals(2, result.getTotalResults());
}
use of org.summerb.easycrud.api.dto.PagerParams in project summerb by skarpushin.
the class GenericCrudServiceTestTemplate method testFindByQueryContains.
@Test
public void testFindByQueryContains() throws Exception {
createTestData();
PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().contains("env", "env-p"));
assertEquals(2, result.getTotalResults());
}
use of org.summerb.easycrud.api.dto.PagerParams in project summerb by skarpushin.
the class GenericCrudServiceTestTemplate method testFindByQueryBooleanFalse.
@Test
public void testFindByQueryBooleanFalse() throws Exception {
createTestData();
PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().isFalse("active"));
assertEquals(1, result.getTotalResults());
result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().ne("active", true));
assertEquals(1, result.getTotalResults());
}
use of org.summerb.easycrud.api.dto.PagerParams in project summerb by skarpushin.
the class GenericCrudServiceTestTemplate method testFindByQueryBetween.
@Test
public void testFindByQueryBetween() throws Exception {
createTestData();
PaginatedList<TestDto1> result = getTestDto1Service().query(new PagerParams(0, 100), Query.n().between("minorVersion", 4, 5));
assertEquals(2, result.getTotalResults());
}
Aggregations