From 59af5770dd7eb6d4c67c10c7a0662ad98c098000 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Fri, 5 Apr 2013 20:44:40 +0200 Subject: [PATCH] DATAJPA-324 - Test case to show property lookup on interface methods work. --- .../query/parser/PartTreeUnitTests.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java b/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java index ea2eb3552..5cfc8a5d9 100644 --- a/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java @@ -349,6 +349,14 @@ public class PartTreeUnitTests { assertThat(tree.isDistinct(), is(true)); } + /** + * @see DATAJPA-324 + */ + @Test + public void resolvesPropertyPathFromGettersOnInterfaces() { + assertThat(new PartTree("findByCategoryId", Product.class), is(notNullValue())); + } + private static void assertType(Iterable sources, Type type, String property) { assertType(sources, type, property, 1, true); } @@ -427,4 +435,14 @@ public class PartTreeUnitTests { String øre; String år; } + + interface Product { + + Category getCategory(); + } + + interface Category { + + Long getId(); + } }