From 47f36f6ba24de32b7e36b82809ae74c7166871ef Mon Sep 17 00:00:00 2001 From: "Greg L. Turnquist" Date: Tue, 25 Jan 2022 10:32:20 -0600 Subject: [PATCH] Fix 'noSuchProperty' test case. The error message for nonexistent properties inside query derivation now wraps the named property with single quotes. This breaks a test case that was looking for spaces before and after. Backported to 2.6.x. See #2418. --- .../jpa/repository/query/PartTreeJpaQueryIntegrationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java index 69afb6a59..d35d09be5 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java @@ -222,7 +222,7 @@ public class PartTreeJpaQueryIntegrationTests { assertThatExceptionOfType(IllegalArgumentException.class) // .isThrownBy(() -> new PartTreeJpaQuery(method, entityManager)) // .withMessageContaining("findByNoSuchProperty") // the method being analyzed - .withMessageContaining(" noSuchProperty ") // the property we are looking for + .withMessageContaining("'noSuchProperty'") // the property we are looking for .withMessageContaining("UserRepository"); // the repository }