Clarify the javadoc of AutoConfigureTestDatabase to make it clearer that it only replaces the main DataSource #23808
Labels
type: documentation
A documentation update
Milestone
TestDatabaseAutoConfiguration
in thegetDataSourceBeanDefinition
method explicitly only finds for the primary data source to replace it with an embedded datasource.When running a Spring Boot app with multiple datasources, you might expect all of them to be replaced with embedded datasources. It would be helpful if a message was logged for all non-primary data sources found explaining that they were not replaced because only replacing the primary data source is supported, possible with a reference to documentation explaining what the recommended approach is in the multiple-datasource scenario.
Also, the Javadoc for
@AutoConfigureTestDatabase
is somewhat misleading here:Actually, not "any" data source is replaced; only a single data source annotated as (or implicitly)
@Primary
.Happy to submit pull requests for all of the above.
The text was updated successfully, but these errors were encountered: