注释类型 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.
可选元素概要
可选元素 修饰符和类型 可选元素 说明 org.springframework.boot.autoconfigure.jdbc.EmbeddedDatabaseConnectionconnectionThe type of connection to be established whenreplacingthe data source.AutoConfigureTestDatabase.ReplacereplaceDetermines what type of existing DataSource beans can be replaced.
元素详细资料
replace
@PropertyMapping(skip=ON_DEFAULT_VALUE) AutoConfigureTestDatabase.Replace replace
Determines what type of existing DataSource beans can be replaced.- 返回:
 - the type of existing DataSource to replace
 
- 默认值:
 - org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase.Replace.ANY
 
connection
org.springframework.boot.autoconfigure.jdbc.EmbeddedDatabaseConnection connection
The type of connection to be established whenreplacingthe data source. By default will attempt to detect the connection based on the classpath.- 返回:
 - the type of connection to use
 
- 默认值:
 - org.springframework.boot.autoconfigure.jdbc.EmbeddedDatabaseConnection.NONE