From 149cfa068c014087901a05960dbe01d6cbb5366f Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Fri, 8 Jun 2012 12:11:30 +0200 Subject: [PATCH] DATACMNS-182 - Added test case showing query method parsing works as expected. --- .../query/parser/PartTreeUnitTests.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spring-data-commons-core/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java b/spring-data-commons-core/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java index fbcd554be..869c7414d 100644 --- a/spring-data-commons-core/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java +++ b/spring-data-commons-core/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java @@ -295,6 +295,18 @@ public class PartTreeUnitTests { assertType(Arrays.asList("birthdayBefore", "birthdayIsBefore"), Type.BEFORE, "birthday"); } + /** + * @see DATACMNS-182 + */ + @Test + public void parsesContainingCorrectly() { + + PartTree tree = new PartTree("findAllByLegalNameContainingOrCommonNameContainingAllIgnoringCase", + Organization.class); + assertPart(tree, new Part[] { new Part("legalNameContaining", Organization.class) }, new Part[] { new Part( + "commonNameContaining", Organization.class) }); + } + private static void assertType(Iterable sources, Type type, String property) { assertType(sources, type, property, 1, true); } @@ -362,4 +374,10 @@ public class PartTreeUnitTests { boolean active; Date birthday; } + + class Organization { + + String commonName; + String legalName; + } }