I have a factory class that returns a bean fine using org.cdisource.beancontainer.BeanContainer calling ...... when I run it from a ..Main class.beanContainer.getBeanByType(..)
If I run the same lines of code in a test I get ...
org.cdisource.beancontainer.BeanNotFoundException: Could not locate a bean of type xxxxx
Is there some step I've missed to get this working from a unit test (.. really an integration test - strictly speaking)?
I have a beans.xml in src/main/resources/META-INF
I've tried putting the same in src/test/resources/META-INF - but this makes no difference.
As far as I understand though this shouldn't be necessary anyway as there is no CDI use in the test itself - only in the factory class that is used in the test.
I've compared the runtime and compile classpaths for main and test and apart from the mocking related dependencies there is no difference.
Could someone give me any pointers of where to look next?