Skip to content

Commit 82ae6e4

Browse files
committed
Improve @AutoConfigureTestDatabase failure message
Fixes gh-6916
1 parent 985ee58 commit 82ae6e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/orm/jpa/TestDatabaseAutoConfiguration.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ public EmbeddedDatabase getEmbeddedDatabase() {
186186
if (EmbeddedDatabaseConnection.NONE.equals(connection)) {
187187
connection = EmbeddedDatabaseConnection.get(getClass().getClassLoader());
188188
}
189+
Assert.state(connection != EmbeddedDatabaseConnection.NONE,
190+
"Cannot determine embedded database for tests. If you want "
191+
+ "an embedded database please put a supported one "
192+
+ "on the classpath.");
189193
return new EmbeddedDatabaseBuilder().setType(connection.getType()).build();
190194
}
191195

0 commit comments

Comments
 (0)