All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.hypersistence.utils.test.providers.DataSourceProvider Maven / Gradle / Ivy

There is a newer version: 3.9.0
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy