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:
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.