Polish "Deprecate EmbeddedDatabaseConnection#HSQL"

See gh-23565
This commit is contained in:
Madhura Bhave 2020-10-01 16:56:48 -07:00
parent d5a1421bbe
commit 7c22e71753
8 changed files with 12 additions and 10 deletions

View File

@ -52,7 +52,7 @@ class DataSourceHealthIndicatorTests {
@BeforeEach
void init() {
EmbeddedDatabaseConnection db = EmbeddedDatabaseConnection.HSQL;
EmbeddedDatabaseConnection db = EmbeddedDatabaseConnection.HSQLDB;
this.dataSource = new SingleConnectionDataSource(db.getUrl("testdb") + ";shutdown=true", "sa", "", false);
this.dataSource.setDriverClassName(db.getDriverClassName());
}

View File

@ -163,7 +163,7 @@ class LiquibaseEndpointTests {
private DataSource createEmbeddedDatabase() {
return new EmbeddedDatabaseBuilder().generateUniqueName(true)
.setType(EmbeddedDatabaseConnection.HSQL.getType()).build();
.setType(EmbeddedDatabaseConnection.HSQLDB.getType()).build();
}
private SpringLiquibase createSpringLiquibase(String changeLog, DataSource dataSource) {

View File

@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@JdbcTest
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED,
connection = EmbeddedDatabaseConnection.HSQL)
connection = EmbeddedDatabaseConnection.HSQLDB)
class JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests {
@Autowired

View File

@ -37,7 +37,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
*/
@JdbcTest
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.HSQL)
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.HSQLDB)
class JdbcTestWithAutoConfigureTestDatabaseReplaceExplicitIntegrationTests {
@Autowired

View File

@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
*/
@JdbcTest
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.HSQL)
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.HSQLDB)
@TestPropertySource(properties = "spring.test.database.replace=ANY")
class JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAnyIntegrationTests {

View File

@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Stephane Nicoll
*/
@JdbcTest
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.HSQL)
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.HSQLDB)
@TestPropertySource(properties = "spring.test.database.replace=AUTO_CONFIGURED")
class JdbcTestWithAutoConfigureTestDatabaseReplacePropertyAutoConfiguredIntegrationTests {

View File

@ -35,6 +35,7 @@ import org.springframework.util.ClassUtils;
* @author Phillip Webb
* @author Dave Syer
* @author Stephane Nicoll
* @author Nidhi Desai
* @since 1.0.0
* @see #get(ClassLoader)
*/
@ -58,6 +59,7 @@ public enum EmbeddedDatabaseConnection {
/**
* HSQL Database Connection.
* @deprecated since 2.4.0 in favor of {@link EmbeddedDatabaseConnection#HSQLDB}.
*/
@Deprecated
HSQL(EmbeddedDatabaseType.HSQL, DatabaseDriver.HSQLDB.getDriverClassName(), "org.hsqldb.jdbcDriver",

View File

@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
* Tests for {@link EmbeddedDatabaseConnection}.
*
* @author Stephane Nicoll
* @author Nidhi Desai
*/
class EmbeddedDatabaseConnectionTests {
@ -40,27 +41,26 @@ class EmbeddedDatabaseConnectionTests {
.isEqualTo("jdbc:derby:memory:myderbydb;create=true");
}
@Deprecated
@Test
@Deprecated
void hsqlCustomDatabaseName() {
assertThat(EmbeddedDatabaseConnection.HSQL.getUrl("myhsql")).isEqualTo("jdbc:hsqldb:mem:myhsql");
}
@Deprecated
@Test
@Deprecated
void getUrlWithNullDatabaseName() {
assertThatIllegalArgumentException().isThrownBy(() -> EmbeddedDatabaseConnection.HSQL.getUrl(null))
.withMessageContaining("DatabaseName must not be empty");
}
@Deprecated
@Test
@Deprecated
void getUrlWithEmptyDatabaseName() {
assertThatIllegalArgumentException().isThrownBy(() -> EmbeddedDatabaseConnection.HSQL.getUrl(" "))
.withMessageContaining("DatabaseName must not be empty");
}
// HSQLDB connection tests added
@Test
void hsqldbCustomDatabaseName() {
assertThat(EmbeddedDatabaseConnection.HSQLDB.getUrl("myhsqldb")).isEqualTo("jdbc:hsqldb:mem:myhsqldb");