use of org.entando.entando.web.common.model.RestListRequest in project entando-core by entando.
the class RestListRequestTest method should_create_default_pagination.
@SuppressWarnings("rawtypes")
@Test
public void should_create_default_pagination() {
RestListRequest request = new RestListRequest();
// filters
List<FieldSearchFilter> filters = request.buildFieldSearchFilters();
assertThat(filters.size(), is(2));
// pagination
assertThat(filters.get(0).getKey(), is(nullValue()));
assertThat(filters.get(0).getLimit(), is(not(nullValue())));
assertThat(filters.get(0).getOffset(), is(not(nullValue())));
}
use of org.entando.entando.web.common.model.RestListRequest in project entando-core by entando.
the class EntityManagerServiceIntegrationTest method testGetManagers.
@Test
public void testGetManagers() {
RestListRequest restListRequest = new RestListRequest();
restListRequest.setPageSize(5);
PagedMetadata<String> res = this.entityManagerService.getEntityManagers(restListRequest);
assertThat(res.getPage(), is(1));
assertThat(res.getPageSize(), is(5));
assertThat(res.getLastPage(), is(1));
assertThat(res.getTotalItems(), is(3));
List<String> result = res.getBody();
assertNotNull(result);
assertEquals(3, result.size());
}
use of org.entando.entando.web.common.model.RestListRequest in project entando-core by entando.
the class EntityManagerServiceIntegrationTest method testGetEntityTypes_2.
@Test
public void testGetEntityTypes_2() {
RestListRequest restListRequest = new RestListRequest();
PagedMetadata<EntityTypeShortDto> dtos = this.entityManagerService.getShortEntityTypes(JacmsSystemConstants.CONTENT_MANAGER, restListRequest);
assertNotNull(dtos);
assertEquals(4, dtos.getBody().size());
}
use of org.entando.entando.web.common.model.RestListRequest in project entando-core by entando.
the class GroupServiceIntegrationTest method testGetGroups_filter.
@Test
public void testGetGroups_filter() throws JsonProcessingException {
RestListRequest restListRequest = new RestListRequest();
restListRequest.addFilter(new Filter("groupname", "fr"));
PagedMetadata<GroupDto> res = this.groupService.getGroups(restListRequest);
assertThat(res.getPage(), is(1));
assertThat(res.getPageSize(), is(100));
assertThat(res.getLastPage(), is(1));
assertThat(res.getTotalItems(), is(1));
}
use of org.entando.entando.web.common.model.RestListRequest in project entando-core by entando.
the class GroupServiceIntegrationTest method testGetGroups_filter_and_pagination.
@Test
public void testGetGroups_filter_and_pagination() throws JsonProcessingException {
RestListRequest restListRequest = new RestListRequest();
restListRequest.setPageSize(2);
restListRequest.addFilter(new Filter("groupname", "s"));
PagedMetadata<GroupDto> res = this.groupService.getGroups(restListRequest);
assertThat(res.getPage(), is(1));
assertThat(res.getPageSize(), is(2));
assertThat(res.getLastPage(), is(2));
assertThat(res.getTotalItems(), is(3));
restListRequest.setPage(1);
res = this.groupService.getGroups(restListRequest);
assertThat(res.getPage(), is(1));
assertThat(res.getPageSize(), is(2));
assertThat(res.getLastPage(), is(2));
assertThat(res.getTotalItems(), is(3));
restListRequest.setPage(2);
res = this.groupService.getGroups(restListRequest);
assertThat(res.getPage(), is(2));
assertThat(res.getPageSize(), is(2));
assertThat(res.getLastPage(), is(2));
assertThat(res.getTotalItems(), is(3));
}
Aggregations