*** The wcm.io Project is closing down this JIRA Instance in favor of GitHub issues. ***
Please use the corresponding GitHub projects to report issues - or the mailing list for general discussion.
org.apache.sling.testing.mock.osgi.ReferenceViolationException: Multiple matches found for unary reference 'modelFactory' for class ../MyServiceImpl.class
Debugger says that there are 110 matching services of ModelFactory are registered, so it cannot pick any particular one.
It works fine with any other References we inject in our project.
I'm trying to test one of my services, which uses OSGi annotation @Reference to inject org.apache.sling.models.factory.ModelFactory.
I'm using AemMocks 2.3.2 (also tested with 2.2.12) and get following error on attempt of service registration:
aemContext.registerInjectActivateService(new MyServiceImpl());
org.apache.sling.testing.mock.osgi.ReferenceViolationException: Multiple matches found for unary reference 'modelFactory' for class ../MyServiceImpl.class
Debugger says that there are 110 matching services of ModelFactory are registered, so it cannot pick any particular one.
It works fine with any other References we inject in our project.