Skip to content

Commit b1f5f34

Browse files
committed
Merge branch '2.4.x'
Closes gh-25693
2 parents 43bc3d3 + 2560f26 commit b1f5f34

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private List<Resource> getResources(String propertyName, List<String> locations,
152152
}
153153
else if (validate) {
154154
throw new InvalidConfigurationPropertyValueException(propertyName, resource,
155-
"The specified resource does not exist.");
155+
"No resources were found at location '" + location + "'.");
156156
}
157157
}
158158
}

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializationIntegrationTests.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,10 @@ void testDataSourceInitializedWithInvalidSchemaResource() {
231231
"spring.datasource.schema:classpath:does/not/exist.sql").run((context) -> {
232232
assertThat(context).hasFailed();
233233
assertThat(context.getStartupFailure()).isInstanceOf(BeanCreationException.class);
234-
assertThat(context.getStartupFailure()).hasMessageContaining("does/not/exist.sql");
234+
assertThat(context.getStartupFailure()).hasMessageContaining("[does/not/exist.sql]");
235235
assertThat(context.getStartupFailure()).hasMessageContaining("spring.datasource.schema");
236+
assertThat(context.getStartupFailure()).hasMessageContaining(
237+
"No resources were found at location 'classpath:does/not/exist.sql'.");
236238
});
237239
}
238240

@@ -243,8 +245,10 @@ void dataSourceInitializedWithInvalidDataResource() {
243245
"spring.datasource.data:classpath:does/not/exist.sql").run((context) -> {
244246
assertThat(context).hasFailed();
245247
assertThat(context.getStartupFailure()).isInstanceOf(BeanCreationException.class);
246-
assertThat(context.getStartupFailure()).hasMessageContaining("does/not/exist.sql");
248+
assertThat(context.getStartupFailure()).hasMessageContaining("[does/not/exist.sql]");
247249
assertThat(context.getStartupFailure()).hasMessageContaining("spring.datasource.data");
250+
assertThat(context.getStartupFailure()).hasMessageContaining(
251+
"No resources were found at location 'classpath:does/not/exist.sql'.");
248252
});
249253
}
250254

0 commit comments

Comments
 (0)