My application uses Websphere data source in production and BasicDataSource in unit testing. So my bean configuration have two different data source types. When I tried to run the unit test case by extending AbstractTransactionalDataSourceSpringContextTests, it failed to autowire the datasource by type because I have two data sources.8.3.3. Transaction management
AbstractTransactionalSpringContextTests depends on a PlatformTransactionManager bean being defined in the application context. The name doesn't matter, due to the use of autowire by type.
Is it possible for me to auto-wire by name? Or any other approaches?


Reply With Quote