joerghoh commented on code in PR #2936:
URL: https://github.com/apache/jackrabbit-oak/pull/2936#discussion_r3369852438
##########
oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/ExternalLoginModuleFactoryTest.java:
##########
@@ -213,6 +214,32 @@ public void testMBeanRegistrationAlreadyPresent() throws
Exception {
assertSame(mbeanregistration, getMBeanRegistration());
}
+ @Test
+ public void testCreateLoginModuleInjectsMonitor() {
+ ExternalIdentityMonitor monitor = mock(ExternalIdentityMonitor.class);
+ context.registerService(ExternalIdentityMonitor.class, monitor);
+ context.registerService(SyncManager.class, mock(SyncManager.class));
+ context.registerService(ExternalIdentityProviderManager.class,
mock(ExternalIdentityProviderManager.class));
+
+ ExternalLoginModuleFactory factory =
context.registerInjectActivateService(ExternalLoginModuleFactory.class);
+ ExternalLoginModule lm = (ExternalLoginModule)
factory.createLoginModule();
+
+ // The monitor must be pre-injected so that initialize() does not open
a
+ // ServiceTracker on every login (which causes Felix EventDispatcher
contention).
+ assertSame(monitor, lm.getMonitor());
+ }
+
+ @Test
+ public void testCreateLoginModuleNullBundleContextNoMonitor() {
Review Comment:
fixed as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]