Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a87f748

Browse files
Fix test for updated derived query error messages.
Signed-off-by: Gerrit Meier <meistermeier@gmail.com>
1 parent f95d078 commit a87f748

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

‎src/test/java/org/springframework/data/neo4j/repository/support/Neo4jRepositoryFactoryTests.java‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ void validateIgnoreCaseShouldWork() {
160160
assertThatExceptionOfType(QueryCreationException.class)
161161
.isThrownBy(() -> this.repositoryFactory.getRepository(InvalidIgnoreCase.class))
162162
.withMessageMatching(
163-
"Could not create query for .*: Only the case of String based properties can be ignored within the following keywords: \\[IsNotLike, NotLike, IsLike, Like, IsStartingWith, StartingWith, StartsWith, IsEndingWith, EndingWith, EndsWith, IsNotContaining, NotContaining, NotContains, IsContaining, Containing, Contains, IsNot, Not, Is, Equals]");
163+
".+ derive query for .*: Only the case of String based properties can be ignored within the following keywords: \\[IsNotLike, NotLike, IsLike, Like, IsStartingWith, StartingWith, StartsWith, IsEndingWith, EndingWith, EndsWith, IsNotContaining, NotContaining, NotContains, IsContaining, Containing, Contains, IsNot, Not, Is, Equals]");
164164
}
165165

166166
@Test
@@ -169,7 +169,7 @@ void validateTemporalShouldWork() {
169169
assertThatExceptionOfType(QueryCreationException.class)
170170
.isThrownBy(() -> this.repositoryFactory.getRepository(InvalidTemporal.class))
171171
.withMessageMatching(
172-
"Could not create query for .*: The keywords \\[IsAfter, After] work only with properties with one of the following types: \\[class java.time.Instant, class java.time.LocalDate, class java.time.LocalDateTime, class java.time.LocalTime, class java.time.OffsetDateTime, class java.time.OffsetTime, class java.time.ZonedDateTime]");
172+
".+ derive query for .*: The keywords \\[IsAfter, After] work only with properties with one of the following types: \\[class java.time.Instant, class java.time.LocalDate, class java.time.LocalDateTime, class java.time.LocalTime, class java.time.OffsetDateTime, class java.time.OffsetTime, class java.time.ZonedDateTime]");
173173
}
174174

175175
@Test
@@ -178,16 +178,15 @@ void validateCollectionShouldWork() {
178178
assertThatExceptionOfType(QueryCreationException.class)
179179
.isThrownBy(() -> this.repositoryFactory.getRepository(InvalidCollection.class))
180180
.withMessageMatching(
181-
"Could not create query for .*: The keywords \\[IsEmpty, Empty] work only with collection properties");
181+
".+ derive query for .*: The keywords \\[IsEmpty, Empty] work only with collection properties");
182182
}
183183

184184
@Test
185185
void validateSpatialShouldWork() {
186186

187187
assertThatExceptionOfType(QueryCreationException.class)
188188
.isThrownBy(() -> this.repositoryFactory.getRepository(InvalidSpatial.class))
189-
.withMessageMatching(
190-
"Could not create query for .* \\[IsNear, Near] works only with spatial properties");
189+
.withMessageMatching(".+ derive query for .* \\[IsNear, Near] works only with spatial properties");
191190
}
192191

193192
@Test
@@ -196,7 +195,7 @@ void validateNotACompositePropertyShouldWork() {
196195
assertThatExceptionOfType(QueryCreationException.class)
197196
.isThrownBy(() -> this.repositoryFactory.getRepository(DerivedWithComposite.class))
198197
.withMessageMatching(
199-
"Could not create query for .*: Derived queries are not supported for composite properties");
198+
".+ derive query for .*: Derived queries are not supported for composite properties");
200199
}
201200

202201
@Test // GH-2281
@@ -205,7 +204,7 @@ void validateDeleteReturnType() {
205204
assertThatExceptionOfType(QueryCreationException.class)
206205
.isThrownBy(() -> this.repositoryFactory.getRepository(InvalidDeleteBy.class))
207206
.withMessageMatching(
208-
"Could not create query for .*: A derived delete query can only return the number of deleted nodes as a long or void");
207+
"A derived delete query can only return the number of deleted nodes as a long or void");
209208
}
210209

211210
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /