@Test
void shouldFindAllWithPageable() {

    Sort sort = Sort.by("name");
    PetDocument petDocument1 = new PetDocument();
    petDocument1.setName("fluffy");
    PetDocument petDocument2 = new PetDocument();
    petDocument2.setName("browny");
    Query query = new Query();
    when(queryService.getMongoDBQuery()).thenReturn(query);
    when(entityInformation.getJavaType()).thenReturn(PetDocument.class);
    when(entityInformation.getCollectionName()).thenReturn("pets");
    when(mongoOperations.find(query.with(sort), PetDocument.class, "pets")).thenReturn(List.of(petDocument2, petDocument1));
    Page<PetDocument> result = target.findAll(PageRequest.of(1, 1, Sort.by("name")));
    assertThat(result, is(notNullValue()));
    assertThat(result.getSize(), is(1));
}