From 881bfbda79ec79a20fdf02a6e627a65a1bed76d7 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. Forward ported to 3.0.x See #2418. --- .../jpa/repository/query/PartTreeJpaQueryIntegrationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java index 58025e45e2..974734efb4 100644 --- a/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java +++ b/spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java @@ -222,7 +222,7 @@ void errorsDueToMissingPropertyContainNameOfMethodAndInterface() throws Exceptio 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 }