@Documented @Inherited @Target(value=TYPE) @Retention(value=RUNTIME) @Repeatable(value=AutoConfigureEmbeddedDatabases.class) public @interface AutoConfigureEmbeddedDatabase
DataSource.
This annotation may be used as a meta-annotation to create custom composed annotations.
EmbeddedDatabaseContextCustomizerFactory| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.String |
beanName
The bean name to identify the data source to be associated with the embedded database.
|
AutoConfigureEmbeddedDatabase.DatabaseProvider |
provider
Provider to be used to create the underlying embedded database, see the documentation for the comparison matrix.
|
AutoConfigureEmbeddedDatabase.RefreshMode |
refresh
Determines the refresh mode of the embedded database.
|
AutoConfigureEmbeddedDatabase.Replace |
replace
Determines what type of existing DataSource beans can be replaced.
|
AutoConfigureEmbeddedDatabase.DatabaseType |
type
The type of embedded database to be created when
replacing the data source. |
public abstract java.lang.String beanName
It is required only if the application context contains multiple DataSource beans.
public abstract AutoConfigureEmbeddedDatabase.RefreshMode refresh
This feature allows for reset the database to its initial state that existed before the test began. It is based on the use of template databases and does not rely on the rollback of the current transaction, so it is possible to save and commit data within the test without any consequences.
The refresh mode may also be configured via the zonky.test.database.refresh configuration property.
public abstract AutoConfigureEmbeddedDatabase.DatabaseType type
replacing the data source.
By default will attempt to detect the database type based on the classpath.
The database type may also be configured via the zonky.test.database.type configuration property.
public abstract AutoConfigureEmbeddedDatabase.DatabaseProvider provider
The provider may also be configured via the zonky.test.database.provider configuration property.
public abstract AutoConfigureEmbeddedDatabase.Replace replace
It may also be configured via the zonky.test.database.replace configuration property.