Skip to content

Commit

Permalink
DATAJPA-362 - Added another test case to make sure invalid like bindi…
Browse files Browse the repository at this point in the history
…ngs are rejected.

Related ticket: DATAJPA-292.
  • Loading branch information
odrotbohm committed Jul 18, 2014
1 parent 84a6d92 commit d40c83d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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%");
Expand Down Expand Up @@ -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<? extends ParameterBinding> bindingType, Integer position,
ParameterBinding expectedBinding) {

Expand Down

0 comments on commit d40c83d

Please sign in to comment.