io.hypersistence.utils.test.providers.DataSourceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hypersistence-utils-hibernate-63 Show documentation
Show all versions of hypersistence-utils-hibernate-63 Show documentation
Utilities for Spring and Hibernate ORM 6.3, 6.4, and 6.5
package io.hypersistence.utils.test.providers;
import org.hibernate.dialect.Database;
import org.testcontainers.containers.JdbcDatabaseContainer;
import javax.sql.DataSource;
/**
* @author Vlad Mihalcea
*/
public interface DataSourceProvider {
Database database();
String hibernateDialect();
DataSource dataSource();
String url();
String username();
String password();
default JdbcDatabaseContainer newJdbcDatabaseContainer() {
throw new UnsupportedOperationException(
String.format(
"The [%s] database was not configured to use Testcontainers!",
database()
)
);
}
default boolean supportsDatabaseName() {
return true;
}
default boolean supportsCredentials() {
return true;
}
}