From 56b63a7a59f5f428ad4f4c5c0b603150cce21a5a Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Fri, 5 Apr 2013 20:54:13 +0200 Subject: [PATCH] DATAJPA-324 - Test case to show property lookup on interface methods work. --- .../query/parser/PartTreeUnitTests.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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 9f3246e33..1614c4ac4 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 @@ -1,5 +1,5 @@ /* - * Copyright 2008-2010 the original author or authors. + * Copyright 2008-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of @@ -318,6 +318,14 @@ public class PartTreeUnitTests { assertTrue(tree.getSort().getOrderFor("år").isAscending()); } + /** + * @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); } @@ -396,4 +404,14 @@ public class PartTreeUnitTests { String øre; String år; } + + interface Product { + + Category getCategory(); + } + + interface Category { + + Long getId(); + } }