BAEL-20663: Fix usage of org.springframework.data.domain.Sort

This commit is contained in:
Krzysiek 2020-01-07 21:52:41 +01:00
parent 5917c9027a
commit fc22587009
1 changed files with 2 additions and 2 deletions

View File

@ -266,7 +266,7 @@ public class UserRepositoryCommon {
userRepository.save(new User(USER_NAME_PETER, LocalDate.now(), USER_EMAIL2, ACTIVE_STATUS));
userRepository.save(new User("SAMPLE", LocalDate.now(), USER_EMAIL3, INACTIVE_STATUS));
List<User> usersSortByName = userRepository.findAll(new Sort(Sort.Direction.ASC, "name"));
List<User> usersSortByName = userRepository.findAll(Sort.by(Sort.Direction.ASC, "name"));
assertThat(usersSortByName.get(0)
.getName()).isEqualTo(USER_NAME_ADAM);
@ -278,7 +278,7 @@ public class UserRepositoryCommon {
userRepository.save(new User(USER_NAME_PETER, LocalDate.now(), USER_EMAIL2, ACTIVE_STATUS));
userRepository.save(new User("SAMPLE", LocalDate.now(), USER_EMAIL3, INACTIVE_STATUS));
userRepository.findAll(new Sort(Sort.Direction.ASC, "name"));
userRepository.findAll(Sort.by(Sort.Direction.ASC, "name"));
List<User> usersSortByNameLength = userRepository.findAll(Sort.by("LENGTH(name)"));