My service class has a reference object of org.apache.sling.api.auth.Authenticator;
While I'm trying to implement a test class I'm getting the below error message for Authenticator.
org.apache.sling.testing.mock.osgi.ReferenceViolationException: Unable to inject mandatory reference 'authenticator' for class MyService
I have tried to create a mock object of Authenticator and registering it but the issue is still there. Can you please help me with this.
@Mock
Authenticator authenticator;
@BeforeEach
void setup(){
context.registerService(Authenticator.class, authenticator);
context.registerInjectActivateService(new MyServiceImpl(), "title", "My Service");
}