批注接口 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 the application-defined or auto-configured
DataSource
. In the case
of multiple DataSource
beans, only the @Primary
DataSource
is considered.- 从以下版本开始:
- 1.5.0
- 作者:
- Phillip Webb
- 另请参阅:
-
嵌套类概要
嵌套类 -
可选元素概要
可选元素修饰符和类型可选元素说明The type of connection to be established whenreplacing
the DataSource.Determines what type of existing DataSource bean can be replaced.
-
元素详细资料
-
replace
Determines what type of existing DataSource bean can be replaced.- 返回:
- the type of existing DataSource to replace
- 默认值:
NON_TEST
-
connection
EmbeddedDatabaseConnection connectionThe type of connection to be established whenreplacing
the DataSource. By default, will attempt to detect the connection based on the classpath.- 返回:
- the type of connection to use
- 默认值:
NONE
-