mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Polish "Deprecate EmbeddedDatabaseConnection#HSQL"
See gh-23565
This commit is contained in:
parent
d5a1421bbe
commit
7c22e71753
@ -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());
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user