Annotation Type AutoConfigureTestDatabase
@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented @Inherited @ImportAutoConfiguration @PropertyMapping("spring.test.database") public @interface AutoConfigureTestDatabase
Annotation that can be applied to a test class to configure a test database to use instead of any application defined or auto-configuredDataSource
.- See Also:
TestDatabaseAutoConfiguration
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description org.springframework.boot.jdbc.EmbeddedDatabaseConnection
connection
The type of connection to be established whenreplacing
the data source.AutoConfigureTestDatabase.Replace
replace
Determines what type of existing DataSource beans can be replaced.
Element Detail
replace
@PropertyMapping(skip=ON_DEFAULT_VALUE) AutoConfigureTestDatabase.Replace replace
Determines what type of existing DataSource beans can be replaced.- Returns:
- the type of existing DataSource to replace
- Default:
- org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase.Replace.ANY
connection
org.springframework.boot.jdbc.EmbeddedDatabaseConnection connection
The type of connection to be established whenreplacing
the data source. By default will attempt to detect the connection based on the classpath.- Returns:
- the type of connection to use
- Default:
- org.springframework.boot.jdbc.EmbeddedDatabaseConnection.NONE