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 @@ -187,28 +187,28 @@ void returnsCorrectIteratorForMultipleElement() {
187
187
assertThat (iterator .hasNext ()).isFalse ();
188
188
}
189
189
190
- @ Test // DATACMNS-139
190
+ @ Test // DATACMNS-139, GH-2395
191
191
void rejectsInvalidPropertyWithLeadingUnderscore () {
192
192
193
193
assertThatExceptionOfType (PropertyReferenceException .class )//
194
194
.isThrownBy (() -> PropertyPath .from ("_id" , Foo .class ))//
195
- .withMessageContaining ("property _id" );
195
+ .withMessageContaining ("property ' _id' " );
196
196
}
197
197
198
- @ Test // DATACMNS-139
198
+ @ Test // DATACMNS-139, GH-2395
199
199
void rejectsNestedInvalidPropertyWithLeadingUnderscore () {
200
200
201
201
assertThatExceptionOfType (PropertyReferenceException .class )//
202
202
.isThrownBy (() -> PropertyPath .from ("_foo_id" , Sample2 .class ))//
203
- .withMessageContaining ("property id " );
203
+ .withMessageContaining ("property 'id' " );
204
204
}
205
205
206
- @ Test // DATACMNS-139
206
+ @ Test // DATACMNS-139, GH-2395
207
207
void rejectsNestedInvalidPropertyExplictlySplitWithLeadingUnderscore () {
208
208
209
209
assertThatExceptionOfType (PropertyReferenceException .class )//
210
210
.isThrownBy (() -> PropertyPath .from ("_foo__id" , Sample2 .class ))//
211
- .withMessageContaining ("property _id" );
211
+ .withMessageContaining ("property ' _id' " );
212
212
}
213
213
214
214
@ Test // DATACMNS 158
Original file line number Diff line number Diff line change @@ -452,7 +452,7 @@ void dummyRepositoryNotSupportingReactiveQbeShouldRaiseException() {
452
452
.hasMessageContaining ("does not support Reactive Query by Example" );
453
453
}
454
454
455
- @ Test // GH-2341
455
+ @ Test // GH-2341, GH-2395
456
456
void derivedQueryMethodCannotBeImplemented () {
457
457
458
458
var factory = new DummyRepositoryFactory (backingRepo ) {
@@ -468,7 +468,7 @@ protected Optional<QueryLookupStrategy> getQueryLookupStrategy(QueryLookupStrate
468
468
469
469
assertThatThrownBy (() -> factory .getRepository (WithQueryMethodUsingInvalidProperty .class ))
470
470
.isInstanceOf (QueryCreationException .class ).hasMessageContaining ("findAllByName" )
471
- .hasMessageContaining ("No property name found for type Object" );
471
+ .hasMessageContaining ("No property ' name' found for type ' Object' " );
472
472
}
473
473
474
474
private ConvertingRepository prepareConvertingRepository (final Object expectedValue ) {
You can’t perform that action at this time.
0 commit comments