Skip to content

Commit 59af577

Browse files
committed
DATAJPA-324 - Test case to show property lookup on interface methods work.
1 parent a7820c8 commit 59af577

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,14 @@ public void identifiesCountAndDistinctByCorrectly() {
349349
assertThat(tree.isDistinct(), is(true));
350350
}
351351

352+
/**
353+
* @see DATAJPA-324
354+
*/
355+
@Test
356+
public void resolvesPropertyPathFromGettersOnInterfaces() {
357+
assertThat(new PartTree("findByCategoryId", Product.class), is(notNullValue()));
358+
}
359+
352360
private static void assertType(Iterable<String> sources, Type type, String property) {
353361
assertType(sources, type, property, 1, true);
354362
}
@@ -427,4 +435,14 @@ class DomainObjectWithSpecialChars {
427435
String øre;
428436
String år;
429437
}
438+
439+
interface Product {
440+
441+
Category getCategory();
442+
}
443+
444+
interface Category {
445+
446+
Long getId();
447+
}
430448
}

0 commit comments

Comments
 (0)