Placing datasource configuration class used for both local dev and unit testing in src/main/java or src/test/java
My application uses springboot with springdatajpa and is connected to two dbs(microsoft sql and mysql). For local developement and unit testing I am using same datasource classes for connecting to two inmemory h2 databases(one with mode mysql and other with mode ms sql). When the application starts “local” profile would be active by default and for unit tests “test” profile is used. Currently the datasource config classes are in src/main. But my senior wants it to be in src/test. I have two questions.
1)If datasource config is used for both local and test env then where should that class be placed?In src/main or src/test?
2)If I am trying to place it in src/test and trying to import it using @Import, i am getting circular dependency error. How can I make sure that data source beans get created when application is started.