Commit 82ae6e40 authored by Phillip Webb's avatar Phillip Webb

Improve @AutoConfigureTestDatabase failure message

Fixes gh-6916
parent 985ee58a
...@@ -186,6 +186,10 @@ public class TestDatabaseAutoConfiguration { ...@@ -186,6 +186,10 @@ public class TestDatabaseAutoConfiguration {
if (EmbeddedDatabaseConnection.NONE.equals(connection)) { if (EmbeddedDatabaseConnection.NONE.equals(connection)) {
connection = EmbeddedDatabaseConnection.get(getClass().getClassLoader()); connection = EmbeddedDatabaseConnection.get(getClass().getClassLoader());
} }
Assert.state(connection != EmbeddedDatabaseConnection.NONE,
"Cannot determine embedded database for tests. If you want "
+ "an embedded database please put a supported one "
+ "on the classpath.");
return new EmbeddedDatabaseBuilder().setType(connection.getType()).build(); return new EmbeddedDatabaseBuilder().setType(connection.getType()).build();
} }
......
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