File tree 3 files changed +11
-11
lines changed
main/java/org/springframework/data/mapping
test/java/org/springframework/data
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2012-2021 the original author or authors.
2
+ * Copyright 2012-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
37
37
public class PropertyReferenceException extends RuntimeException {
38
38
39
39
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' ?" ;
42
42
43
43
private final String propertyName ;
44
44
private final TypeInformation <?> type ;
Original file line number Diff line number Diff line change @@ -188,28 +188,28 @@ void returnsCorrectIteratorForMultipleElement() {
188
188
assertThat (iterator .hasNext ()).isFalse ();
189
189
}
190
190
191
- @ Test // DATACMNS-139
191
+ @ Test // DATACMNS-139, GH-2395
192
192
void rejectsInvalidPropertyWithLeadingUnderscore () {
193
193
194
194
assertThatExceptionOfType (PropertyReferenceException .class )//
195
195
.isThrownBy (() -> PropertyPath .from ("_id" , Foo .class ))//
196
- .withMessageContaining ("property _id" );
196
+ .withMessageContaining ("property ' _id' " );
197
197
}
198
198
199
- @ Test // DATACMNS-139
199
+ @ Test // DATACMNS-139, GH-2395
200
200
void rejectsNestedInvalidPropertyWithLeadingUnderscore () {
201
201
202
202
assertThatExceptionOfType (PropertyReferenceException .class )//
203
203
.isThrownBy (() -> PropertyPath .from ("_foo_id" , Sample2 .class ))//
204
- .withMessageContaining ("property id " );
204
+ .withMessageContaining ("property 'id' " );
205
205
}
206
206
207
- @ Test // DATACMNS-139
207
+ @ Test // DATACMNS-139, GH-2395
208
208
void rejectsNestedInvalidPropertyExplictlySplitWithLeadingUnderscore () {
209
209
210
210
assertThatExceptionOfType (PropertyReferenceException .class )//
211
211
.isThrownBy (() -> PropertyPath .from ("_foo__id" , Sample2 .class ))//
212
- .withMessageContaining ("property _id" );
212
+ .withMessageContaining ("property ' _id' " );
213
213
}
214
214
215
215
@ Test // DATACMNS 158
Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ void dummyRepositoryNotSupportingReactiveQbeShouldRaiseException() {
453
453
.hasMessageContaining ("does not support Reactive Query by Example" );
454
454
}
455
455
456
- @ Test // GH-2341
456
+ @ Test // GH-2341, GH-2395
457
457
void derivedQueryMethodCannotBeImplemented () {
458
458
459
459
DummyRepositoryFactory factory = new DummyRepositoryFactory (backingRepo ) {
@@ -469,7 +469,7 @@ protected Optional<QueryLookupStrategy> getQueryLookupStrategy(QueryLookupStrate
469
469
470
470
assertThatThrownBy (() -> factory .getRepository (WithQueryMethodUsingInvalidProperty .class ))
471
471
.isInstanceOf (QueryCreationException .class ).hasMessageContaining ("findAllByName" )
472
- .hasMessageContaining ("No property name found for type Object" );
472
+ .hasMessageContaining ("No property ' name' found for type ' Object' " );
473
473
}
474
474
475
475
private ConvertingRepository prepareConvertingRepository (final Object expectedValue ) {
You can’t perform that action at this time.
0 commit comments