Follow up on https://github.com/spring-projects/spring-data-examples/issues/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 {
}
Comment From: wilkinsona
Thanks for the suggestion. This is a small part of the changes that are being tracked by https://github.com/spring-projects/spring-boot/issues/15732.