spring配置多数据源t junit测试报错 5C

Error creating bean with name 'seentao.workflow.engine.EngineTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests.setDataSource(javax.sql.DataSource); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.sql.DataSource] is defined: expected single matching bean but found 3: [mysql, mysqlTo, dynamicDatasource]

报错信息的意识是,spring配置了[mysql, mysqlTo, dynamicDatasource]3个数据源,测试时不知道使用哪一个,请教如何配置junit才能不报错。

0

1个回答

注解时byName 不要byType

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!