I'm trying to test my DAO implementations and, for this, I wrote a new config file with my test data source definition. But, at the same time, I have to use another config file (the one used in production) because it has another beans definitions.
I created a subclass of AbstractTransactionalDataSourceSpringContextTests.
But executing the test I got the following error:
org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'pt.ptinovacao.invivo.test.promotion.PromotionTest s' defined in null: Unsatisfied dependency expressed through bean property 'dataSource': There are 2 beans of type [interface javax.sql.DataSource] for autowire by type. There should have been 1 to be able to autowire property 'dataSource' of bean 'pt.ptinovacao.invivo.test.promotion.PromotionTest s'.
How can I say my test to use only the data source I defined for testing?