Skip to content

Commit

Permalink
Document findBy(Pageable) for Firestore (#410)
Browse files Browse the repository at this point in the history
This is a substitute for `findAll(Pageable)`.

Related to #409.
  • Loading branch information
meltsufin authored Mar 25, 2021
1 parent bb71964 commit f33286c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/
//tag::repository[]
public interface UserRepository extends FirestoreReactiveRepository<User> {
Flux<User> findBy(Pageable pageable);

Flux<User> findByAge(Integer age);

Flux<User> findByAgeNot(Integer age);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public void partTreeRepositoryMethodTest() {
this.userRepository.saveAll(users).blockLast();

assertThat(this.userRepository.count().block()).isEqualTo(2);
assertThat(this.userRepository.findBy(PageRequest.of(0, 10)).collectList().block()).containsExactly(u1, u2);
assertThat(this.userRepository.findByAge(22).collectList().block()).containsExactly(u1);
assertThat(this.userRepository.findByAgeNot(22).collectList().block()).containsExactly(u2);
assertThat(this.userRepository.findByHomeAddressCountry("USA").collectList().block()).containsExactly(u1);
Expand Down

0 comments on commit f33286c

Please sign in to comment.