DATAJPA-201 - Test case showing handing in null for Pageable arguments works.

This commit is contained in:
Oliver Gierke
2012-04-26 19:22:40 +02:00
parent b66d26ba98
commit 9c20aff99d

View File

@@ -815,6 +815,22 @@ public class UserRepositoryTests {
assertThat(result, hasItems(secondUser, thirdUser));
}
/**
* @see DATAJPA-201
*/
public void allowsExecutingPageableMethodWithNullPageable() {
flushTestUsers();
List<User> users = repository.findByFirstname("Oliver", null);
assertThat(users.size(), is(1));
assertThat(users, hasItem(firstUser));
Page<User> page = repository.findByFirstnameIn(null, "Oliver");
assertThat(page.getNumberOfElements(), is(1));
assertThat(page.getContent(), hasItem(firstUser));
}
protected void flushTestUsers() {
firstUser = repository.save(firstUser);