I have been looking at the source code trying to understand this, so far I found things like this:
@Bean
DataSource db1DataSource() {
return new EmbeddedDatabaseBuilder()
.generateUniqueName(true)
.setType(EmbeddedDatabaseType.HSQL)
.build();
}
Which works for registering data sources with the EmbeddedDatabase.
That gave me the idea of doing something like…:
@Bean
DataSource db1DataSource(MyStoreConfiguration myStoreConfiguration) {
// instantiate the dataSource
}
But it fails miserably complaining that no beans can provide MyStoreConfiguration (which is on MyStoreConfiguration.class
next to the main Configuration class.
I see I could instantiate the DataSource by hand like here but I need the Configuration class to read the properties file (I want to put in some integration tests that make sure the MSSQL database works as expected)
So… still stuck not knowing how to register my additional dataSource for testing