DATAJPA-1519 - Fixed broken test.

Made the test more specific which demonstrated that the test was broken in the first place.
This commit is contained in:
Jens Schauder
2019-04-01 11:52:24 +02:00
parent ee03f9b4a5
commit 51c2e9e445
2 changed files with 7 additions and 2 deletions

View File

@@ -205,7 +205,12 @@ public class UserRepositoryFinderTests {
@Test // DATAJPA-1519
public void escapingInLikeSpels() {
assertThat(userRepository.findContainingEscaped("att_"), iterableWithSize(0));
User extra = new User("extra", "Matt_ew", "extra");
userRepository.save(extra);
List<User> result = userRepository.findContainingEscaped("att_");
assertThat(result, containsInAnyOrder(extra));
}
@Test // DATAJPA-829

View File

@@ -557,7 +557,7 @@ public interface UserRepository
List<NameOnlyDto> findByNamedQueryWithConstructorExpression();
// DATAJPA-1519
@Query("select u from User u where u.firstname like %?#{escape([0])}% escape ?#{escapeCharacter()}")
@Query("select u from User u where u.lastname like %?#{escape([0])}% escape ?#{escapeCharacter()}")
List<User> findContainingEscaped(String namePart);
interface RolesAndFirstname {