Examples of PageRequest


Examples of org.springframework.data.domain.PageRequest

    Method method = ManualCrudRepository.class.getMethod("findAll");
    ManualCrudRepository repository = mock(ManualCrudRepository.class);

    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll((Pageable) null);
    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll(new PageRequest(0, 10));
    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll((Sort) null);
    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll(new Sort("foo"));
  }
View Full Code Here

Examples of org.springframework.data.domain.PageRequest

    Method method = RepoWithFindAllWithSort.class.getMethod("findAll", Sort.class);
    RepoWithFindAllWithSort repository = mock(RepoWithFindAllWithSort.class);

    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll((Pageable) null);
    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll(new PageRequest(0, 10));
    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll((Sort) null);
    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll(new Sort("foo"));
  }
View Full Code Here

Examples of org.springframework.data.domain.PageRequest

    Method method = RepoWithFindAllWithPageable.class.getMethod("findAll", Pageable.class);
    RepoWithFindAllWithPageable repository = mock(RepoWithFindAllWithPageable.class);

    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll((Pageable) null);
    getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll(new PageRequest(0, 10));
  }
View Full Code Here

Examples of org.springframework.data.domain.PageRequest

    WebApplicationContext context = WebTestUtils.createApplicationContext(Config.class);
    SampleController controller = context.getBean(SampleController.class);

    assertThat(controller.assembler, is(notNullValue()));

    PagedResources<Resource<Person>> resources = controller.sample(new PageRequest(1, 1));

    assertThat(resources.getLink(Link.REL_PREVIOUS), is(notNullValue()));
    assertThat(resources.getLink(Link.REL_NEXT), is(notNullValue()));
    assertThat(resources.getLink(Link.REL_SELF), is(notNullValue()));
  }
View Full Code Here

Examples of org.springframework.data.domain.PageRequest

  @Test
  public void createsRepositoryInstanceWithCustomIntermediateRepository() {

    CustomRepository repository = factory.getRepository(CustomRepository.class);
    Pageable pageable = new PageRequest(0, 10);
    repository.findAll(pageable);

    verify(backingRepo, times(1)).findAll(pageable);
  }
View Full Code Here

Examples of org.springframework.data.domain.PageRequest

        PropertyFilters.get("EQI_state", "1")
    )),new Sort(Direction.DESC, "loginName","realName"));
    Assert.assertEquals(userList.size(), 5);
   
   
    Pageable pageable = new PageRequest(1, 2);
    Page<User> page = userRepository.findAll(Specifications.get(Lists.newArrayList(PropertyFilters.get("EQI_state", "1"))),pageable);
    Assert.assertEquals(page.getContent().size(), 2);
    Assert.assertEquals(page.getTotalPages(), 4);
    Assert.assertEquals(page.getTotalElements(), 8);
  }
View Full Code Here

Examples of org.springframework.data.domain.PageRequest

        for (int i = 0; i < 35; i++) {
            createProfessional(firstName, lastName, companyName, ADDR);
        }
       
        Page<Person> pageResult = personRepository.findByAddress(ADDR, new PageRequest(page, size));
        List<Person> persons = pageResult.getContent();
       
        int expectedCount = size;
       
        assertNotNull("Person list is null.", persons);
        assertEquals("Number of persons should be " + expectedCount + ".", expectedCount, persons.size());

        // query last page
        page = pageResult.getTotalPages() - 1;
        pageResult = personRepository.findByAddress(ADDR, new PageRequest(page, size));
        persons = pageResult.getContent();
       
        // created 35 records with the same address, one existing
        expectedCount = 6;
       
View Full Code Here

Examples of org.uberfire.paging.PageRequest

        super( PAGE_SIZE );
        this.m2RepoService = m2RepoService;

        setDataProvider( new AsyncDataProvider<JarListPageRow>() {
            protected void onRangeChanged( HasData<JarListPageRow> display ) {
                PageRequest request = new PageRequest( pager.getPageStart(), pageSize );

                m2RepoService.call( new RemoteCallback<PageResponse<JarListPageRow>>() {
                    @Override
                    public void callback( final PageResponse<JarListPageRow> response ) {
                        updateRowCount( response.getTotalRowSize(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.