Improve @AutoConfigureTestDatabase failure message

Fixes gh-6916
This commit is contained in:
Phillip Webb 2016-09-17 19:56:25 -07:00
parent 985ee58ad7
commit 82ae6e4049

View File

@ -186,6 +186,10 @@ public class TestDatabaseAutoConfiguration {
if (EmbeddedDatabaseConnection.NONE.equals(connection)) {
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();
}