diff --git a/src/test/java/org/springframework/data/jpa/repository/query/StringQueryUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/StringQueryUnitTests.java index b7aeae944b..6f19670084 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/StringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/StringQueryUnitTests.java @@ -182,6 +182,9 @@ public void handlesMultipleNamedLikeBindingsCorrectly() { new StringQuery("select u from User u where u.firstname like %:firstname or foo like :bar"); } + /** + * @see DATAJPA-292, DATAJPA-362 + */ @Test(expected = IllegalArgumentException.class) public void rejectsDifferentBindingsForRepeatedParameter() { new StringQuery("select u from User u where u.firstname like %?1 and u.lastname like ?1%"); @@ -302,6 +305,14 @@ public void detectsInBindingWithSpecialCharactersAndWordCharactersMixedInParenth assertNamedBinding(InParameterBinding.class, "ab1babc생일233", bindings.get(0)); } + /** + * @see DATAJPA-362 + */ + @Test(expected = IllegalArgumentException.class) + public void rejectsDifferentBindingsForRepeatedParameter2() { + new StringQuery("select u from User u where u.firstname like ?1 and u.lastname like %?1"); + } + private void assertPositionalBinding(Class bindingType, Integer position, ParameterBinding expectedBinding) {