Commit a832cc9c authored by Andy Wilkinson's avatar Andy Wilkinson

Polish "Improve error message when no resources exist at a script location"

See gh-25620
parent 42841b89
......@@ -161,7 +161,7 @@ class DataSourceInitializer {
}
else if (validate) {
throw new InvalidConfigurationPropertyValueException(propertyName, resource,
"Resource '" + location + "' does not exist.");
"No resources were found at location '" + location + "'.");
}
}
}
......
......@@ -223,8 +223,8 @@ class DataSourceInitializerInvokerTests {
assertThat(context.getStartupFailure()).isInstanceOf(BeanCreationException.class);
assertThat(context.getStartupFailure()).hasMessageContaining("[does/not/exist.sql]");
assertThat(context.getStartupFailure()).hasMessageContaining("spring.datasource.schema");
assertThat(context.getStartupFailure())
.hasMessageContaining("Resource 'classpath:does/not/exist.sql' does not exist.");
assertThat(context.getStartupFailure()).hasMessageContaining(
"No resources were found at location 'classpath:does/not/exist.sql'.");
});
}
......@@ -237,8 +237,8 @@ class DataSourceInitializerInvokerTests {
assertThat(context.getStartupFailure()).isInstanceOf(BeanCreationException.class);
assertThat(context.getStartupFailure()).hasMessageContaining("[does/not/exist.sql]");
assertThat(context.getStartupFailure()).hasMessageContaining("spring.datasource.data");
assertThat(context.getStartupFailure())
.hasMessageContaining("Resource 'classpath:does/not/exist.sql' does not exist.");
assertThat(context.getStartupFailure()).hasMessageContaining(
"No resources were found at location 'classpath:does/not/exist.sql'.");
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment