Polish "Include AbstractJdbcConfiguration beans in @DataJdbcTest"

See gh-29003
This commit is contained in:
Stephane Nicoll
2022-01-04 15:32:23 +01:00
parent 7f8dd81947
commit 9b34c31916
4 changed files with 29 additions and 27 deletions

View File

@@ -595,7 +595,7 @@ If you prefer your test to run against a real database, you can use the `@AutoCo
==== Auto-configured Data JDBC Tests
`@DataJdbcTest` is similar to `@JdbcTest` but is for tests that use Spring Data JDBC repositories.
By default, it configures an in-memory embedded database, a `JdbcTemplate`, and Spring Data JDBC repositories.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataJdbcTest` annotation is used.
Only `AbstractJdbcConfiguration` sub-classes are scanned when the `@DataJdbcTest` annotation is used, regular `@Component` and `@ConfigurationProperties` beans are not scanned.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
TIP: A list of the auto-configurations that are enabled by `@DataJdbcTest` can be <<test-auto-configuration#test-auto-configuration,found in the appendix>>.