/** * Create an instance of {@link PagingType } * */ public PagingType createPagingType() { return new PagingType(); }
/** * Create an instance of {@link PagingType } * */ public PagingType createPagingType() { return new PagingType(); }
/** * Create an instance of {@link PagingType } * */ public PagingType createPagingType() { return new PagingType(); }
@Test(expectedExceptions = FaultMessage.class) public void badPagingSearch() throws FaultMessage, SchemaException, IOException, JAXBException { PagingType paging = new PagingType(); paging.setMaxSize(-1); paging.setOffset(-1); final UserType expectedUser = (UserType) PrismTestUtil.parseObject(new File(TEST_FOLDER_CONTROLLER, "./addObject/add-user-without-name.xml")).asObjectable(); setSecurityContext(expectedUser); try { QueryType queryType = new QueryType(); queryType.setPaging(paging); modelService.searchObjects(UserType.COMPLEX_TYPE, queryType, null, new Holder<>(), new Holder<>()); } catch (FaultMessage ex) { ModelTUtil.assertIllegalArgumentFault(ex); } finally { SecurityContextHolder.getContext().setAuthentication(null); } Assert.fail("Illegal argument exception was not thrown."); }
public static PagingType createPagingType(ObjectPaging paging){ if (paging == null){ return null; } PagingType pagingType = new PagingType(); pagingType .setOrderDirection(toOrderDirectionType(paging.getDirection())); pagingType.setMaxSize(paging.getMaxSize()); pagingType.setOffset(paging.getOffset()); if (paging.getOrderBy() != null) { pagingType.setOrderBy(new ItemPathType(paging.getOrderBy())); } if (paging.getGroupBy() != null) { pagingType.setGroupBy(new ItemPathType(paging.getGroupBy())); } return pagingType; }