pchudzik / springmock

alternative spring mocking infrastructure
https://blog.pchudzik.com/201707/springmock-v1/
MIT License
22 stars 4 forks source link

inject mocks by name #9

Closed pchudzik closed 7 years ago

pchudzik commented 7 years ago

see test case com.pchudzik.springmock.infrastructure.test.name.DoubleNameShouldBeUsedAsQualifier it should be possible to inject different mocks without the @Qualifier annotation

currently it fails with: Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.pchudzik.springmock.infrastructure.test.name.DoubleNameShouldBeUsedAsQualifier$MockService' available: expected single matching bean but found 2: mock1,mock2

pchudzik commented 7 years ago

when it's implemented fix: com.pchudzik.springmock.infrastructure.test.inject.ShouldReplaceBeansWithDoubles com.pchudzik.springmock.infrastructure.test.inject.ShouldReplaceFactoryBeanWithDoubles