Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support @AutoConfigureTestDatabase with multiple DataSources #21423

Closed
membersound opened this issue May 12, 2020 · 1 comment
Closed

Support @AutoConfigureTestDatabase with multiple DataSources #21423

membersound opened this issue May 12, 2020 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@membersound
Copy link

membersound commented May 12, 2020

Follow up on spring-projects/spring-data-examples#332

Problem: if multiple datasources are configured, it would still be nice if @AutoConfigureTestDatabase could pick any DataSource around and apply H2 embedded test-database settings application-wide.

spring.datasource.url=jdbc:mysql://localhost:3306/localdb
spring.datasource.username=root
spring.datasource.password=rootpw

bar.datasource.url=jdbc:mysql://remotehost:3306/remotedb
bar.datasource.username=root
bar.datasource.password=rootpw

Now it would be nice if we could just use the following:

@SpringBootApplication
@AutoConfigureTestDatabase(Replace.ANY)
public class MyJunitTest {

}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 12, 2020
@wilkinsona
Copy link
Member

Thanks for the suggestion. This is a small part of the changes that are being tracked by #15732.

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants