File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed
main/java/org/springframework/data/mapping
test/java/org/springframework/data Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2012-2021 the original author or authors.
2+ * Copyright 2012-2022 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
3737public class PropertyReferenceException extends RuntimeException {
3838
3939 private static final long serialVersionUID = -5254424051438976570L ;
40- private static final String ERROR_TEMPLATE = "No property %s found for type %s !" ;
41- private static final String HINTS_TEMPLATE = " Did you mean %s ?" ;
40+ private static final String ERROR_TEMPLATE = "No property '%s' found for type '%s' !" ;
41+ private static final String HINTS_TEMPLATE = " Did you mean '%s' ?" ;
4242
4343 private final String propertyName ;
4444 private final TypeInformation <?> type ;
Original file line number Diff line number Diff line change @@ -188,28 +188,28 @@ void returnsCorrectIteratorForMultipleElement() {
188188 assertThat (iterator .hasNext ()).isFalse ();
189189 }
190190
191- @ Test // DATACMNS-139
191+ @ Test // DATACMNS-139, GH-2395
192192 void rejectsInvalidPropertyWithLeadingUnderscore () {
193193
194194 assertThatExceptionOfType (PropertyReferenceException .class )//
195195 .isThrownBy (() -> PropertyPath .from ("_id" , Foo .class ))//
196- .withMessageContaining ("property _id" );
196+ .withMessageContaining ("property ' _id' " );
197197 }
198198
199- @ Test // DATACMNS-139
199+ @ Test // DATACMNS-139, GH-2395
200200 void rejectsNestedInvalidPropertyWithLeadingUnderscore () {
201201
202202 assertThatExceptionOfType (PropertyReferenceException .class )//
203203 .isThrownBy (() -> PropertyPath .from ("_foo_id" , Sample2 .class ))//
204- .withMessageContaining ("property id " );
204+ .withMessageContaining ("property 'id' " );
205205 }
206206
207- @ Test // DATACMNS-139
207+ @ Test // DATACMNS-139, GH-2395
208208 void rejectsNestedInvalidPropertyExplictlySplitWithLeadingUnderscore () {
209209
210210 assertThatExceptionOfType (PropertyReferenceException .class )//
211211 .isThrownBy (() -> PropertyPath .from ("_foo__id" , Sample2 .class ))//
212- .withMessageContaining ("property _id" );
212+ .withMessageContaining ("property ' _id' " );
213213 }
214214
215215 @ Test // DATACMNS 158
Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ void dummyRepositoryNotSupportingReactiveQbeShouldRaiseException() {
453453 .hasMessageContaining ("does not support Reactive Query by Example" );
454454 }
455455
456- @ Test // GH-2341
456+ @ Test // GH-2341, GH-2395
457457 void derivedQueryMethodCannotBeImplemented () {
458458
459459 DummyRepositoryFactory factory = new DummyRepositoryFactory (backingRepo ) {
@@ -469,7 +469,7 @@ protected Optional<QueryLookupStrategy> getQueryLookupStrategy(QueryLookupStrate
469469
470470 assertThatThrownBy (() -> factory .getRepository (WithQueryMethodUsingInvalidProperty .class ))
471471 .isInstanceOf (QueryCreationException .class ).hasMessageContaining ("findAllByName" )
472- .hasMessageContaining ("No property name found for type Object" );
472+ .hasMessageContaining ("No property ' name' found for type ' Object' " );
473473 }
474474
475475 private ConvertingRepository prepareConvertingRepository (final Object expectedValue ) {
You can’t perform that action at this time.
0 commit comments