Move "testdb" naming to DataSourceProperties

Move the "testdb" naming logic to `DataSourceProperties` and expose
the `deduceDatabaseName` method so they can be used in
auto-configuration.

See gh-11719
This commit is contained in:
Phillip Webb
2018-01-24 19:50:06 -08:00
parent b67903a04a
commit d61ba241b5
7 changed files with 40 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,9 +50,8 @@ public class DataSourceHealthIndicatorTests {
@Before
public void init() {
EmbeddedDatabaseConnection db = EmbeddedDatabaseConnection.HSQL;
this.dataSource = new SingleConnectionDataSource(db.getUrl(
EmbeddedDatabaseConnection.DEFAULT_DATABASE_NAME) + ";shutdown=true",
"sa", "", false);
this.dataSource = new SingleConnectionDataSource(
db.getUrl("testdb") + ";shutdown=true", "sa", "", false);
this.dataSource.setDriverClassName(db.getDriverClassName());
}