test_class.declarator: bundleContext = mock(BundleContext.class)
test_class.modifier: private final
test_class.original_string: private final BundleContext bundleContext = mock(BundleContext.class);
test_class.type: BundleContext
test_class.var_name: bundleContext
test_class.declarator: ref = mock(ServiceReference.class)
test_class.modifier: private final
test_class.original_string: private final ServiceReference ref = mock(ServiceReference.class);
test_class.type: ServiceReference
test_class.var_name: ref
test_class.declarator: mappingTracker
test_class.modifier: private
test_class.original_string: private SyncHandlerMappingTracker mappingTracker;
test_class.type: SyncHandlerMappingTracker
test_class.var_name: mappingTracker
test_class.declarator: tracker
test_class.modifier: private
test_class.original_string: private SyncConfigTracker tracker;
test_class.type: SyncConfigTracker
test_class.var_name: tracker
test_class.declarator: service = mock(SyncHandler.class)
test_class.modifier: private
test_class.original_string: private SyncHandler service = mock(SyncHandler.class);
test_class.type: SyncHandler
test_class.var_name: service
test_class.file: oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/SyncConfigTrackerTest.java
test_class.identifier: SyncConfigTrackerTest
test_case.body: @Test
      public void testGetAutoMembership() {
          assertTrue(tracker.getAutoMembership().isEmpty());
  
          String[] gam = new String[] {"g1", "g2"};
          String[] uam = new String[] {"g3", "g4"};
          when(ref.getProperty(PARAM_NAME)).thenReturn("sh");
          when(ref.getProperty(PARAM_GROUP_AUTO_MEMBERSHIP)).thenReturn(gam);
          when(ref.getProperty(PARAM_USER_AUTO_MEMBERSHIP)).thenReturn(uam);
          when(ref.getProperty(PARAM_USER_DYNAMIC_MEMBERSHIP)).thenReturn(true);
          tracker.addingService(ref);
  
          ServiceReference mappingRef = mock(ServiceReference.class);
          when(mappingRef.getProperty(PARAM_IDP_NAME)).thenReturn("idp");
          when(mappingRef.getProperty(PARAM_SYNC_HANDLER_NAME)).thenReturn("sh");
          mappingTracker.addingService(mappingRef);
  
          Map<String,String[]> automembership = tracker.getAutoMembership();
          assertEquals(1, automembership.size());
          assertArrayEquals(ObjectArrays.concat(uam,gam,String.class), automembership.get("idp"));
      }
test_case.class_method_signature: SyncConfigTrackerTest.testGetAutoMembership()
test_case.full_signature: @Test public void testGetAutoMembership()
test_case.identifier: testGetAutoMembership
test_case.invocations: assertTrue isEmpty getAutoMembership thenReturn when getProperty thenReturn when getProperty thenReturn when getProperty thenReturn when getProperty addingService mock thenReturn when getProperty thenReturn when getProperty addingService getAutoMembership assertEquals size assertArrayEquals concat get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetAutoMembership()
focal_class.declarator: log = LoggerFactory.getLogger(SyncConfigTracker.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(SyncConfigTracker.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: mappingTracker
focal_class.modifier: private final
focal_class.original_string: private final SyncHandlerMappingTracker mappingTracker;
focal_class.type: SyncHandlerMappingTracker
focal_class.var_name: mappingTracker
focal_class.declarator: enablingRefs = new HashSet<>()
focal_class.modifier: private
focal_class.original_string: private Set<ServiceReference> enablingRefs = new HashSet<>();
focal_class.type: Set<ServiceReference>
focal_class.var_name: enablingRefs
focal_class.declarator: isEnabled = false
focal_class.modifier: private
focal_class.original_string: private boolean isEnabled = false;
focal_class.type: boolean
focal_class.var_name: isEnabled
focal_class.file: oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/principal/SyncConfigTracker.java
focal_class.identifier: SyncConfigTracker
focal_class.class_method_signature: SyncConfigTracker.SyncConfigTracker(@NotNull BundleContext context, @NotNull SyncHandlerMappingTracker mappingTracker)
focal_class.full_signature:   SyncConfigTracker(@NotNull BundleContext context, @NotNull SyncHandlerMappingTracker mappingTracker)
focal_class.identifier: SyncConfigTracker
focal_class.parameters: (@NotNull BundleContext context, @NotNull SyncHandlerMappingTracker mappingTracker)
focal_class.signature:  SyncConfigTracker(@NotNull BundleContext context, @NotNull SyncHandlerMappingTracker mappingTracker)
focal_class.class_method_signature: SyncConfigTracker.addingService(ServiceReference reference)
focal_class.full_signature: @Override public Object addingService(ServiceReference reference)
focal_class.identifier: addingService
focal_class.modifiers: @Override public
focal_class.parameters: (ServiceReference reference)
focal_class.return: Object
focal_class.signature: Object addingService(ServiceReference reference)
focal_class.class_method_signature: SyncConfigTracker.modifiedService(ServiceReference reference, Object service)
focal_class.full_signature: @Override public void modifiedService(ServiceReference reference, Object service)
focal_class.identifier: modifiedService
focal_class.modifiers: @Override public
focal_class.parameters: (ServiceReference reference, Object service)
focal_class.return: void
focal_class.signature: void modifiedService(ServiceReference reference, Object service)
focal_class.class_method_signature: SyncConfigTracker.removedService(ServiceReference reference, Object service)
focal_class.full_signature: @Override public void removedService(ServiceReference reference, Object service)
focal_class.identifier: removedService
focal_class.modifiers: @Override public
focal_class.parameters: (ServiceReference reference, Object service)
focal_class.return: void
focal_class.signature: void removedService(ServiceReference reference, Object service)
focal_class.class_method_signature: SyncConfigTracker.hasDynamicMembership(@NotNull ServiceReference reference)
focal_class.full_signature: private static boolean hasDynamicMembership(@NotNull ServiceReference reference)
focal_class.identifier: hasDynamicMembership
focal_class.modifiers: private static
focal_class.parameters: (@NotNull ServiceReference reference)
focal_class.return: boolean
focal_class.signature: boolean hasDynamicMembership(@NotNull ServiceReference reference)
focal_class.class_method_signature: SyncConfigTracker.isEnabled()
focal_class.full_signature:  boolean isEnabled()
focal_class.identifier: isEnabled
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEnabled()
focal_class.class_method_signature: SyncConfigTracker.getAutoMembership()
focal_class.full_signature: @NotNull Map<String, String[]> getAutoMembership()
focal_class.identifier: getAutoMembership
focal_class.modifiers: @NotNull
focal_class.parameters: ()
focal_class.return: Map<String, String[]>
focal_class.signature: Map<String, String[]> getAutoMembership()
focal_class.superclass: extends ServiceTracker
focal_method.body: @NotNull
      Map<String, String[]> getAutoMembership() {
          Map<String, String[]> autoMembership = new HashMap<>();
          for (ServiceReference ref : enablingRefs) {
              String syncHandlerName = PropertiesUtil.toString(ref.getProperty(DefaultSyncConfigImpl.PARAM_NAME), DefaultSyncConfigImpl.PARAM_NAME_DEFAULT);
              String[] userAuthMembership = PropertiesUtil.toStringArray(ref.getProperty(DefaultSyncConfigImpl.PARAM_USER_AUTO_MEMBERSHIP), new String[0]);
              String[] groupAuthMembership = PropertiesUtil.toStringArray(ref.getProperty(DefaultSyncConfigImpl.PARAM_GROUP_AUTO_MEMBERSHIP), new String[0]);
              String[] membership =  ObjectArrays.concat(userAuthMembership, groupAuthMembership, String.class);
  
              for (String idpName : mappingTracker.getIdpNames(syncHandlerName)) {
                  String[] previous = autoMembership.put(idpName, membership);
                  if (previous != null) {
                      String msg = (Arrays.equals(previous, membership)) ? "Duplicate" : "Colliding";
                      String prev = Arrays.toString(previous);
                      String mbrs = Arrays.toString(membership);
                      log.debug("{} auto-membership configuration for IDP '{}'; replacing previous values {} by {} defined by SyncHandler '{}'",
                              msg, idpName, prev, mbrs, syncHandlerName);
                  }
              }
          }
          return autoMembership;
      }
focal_method.class_method_signature: SyncConfigTracker.getAutoMembership()
focal_method.full_signature: @NotNull Map<String, String[]> getAutoMembership()
focal_method.identifier: getAutoMembership
focal_method.invocations: toString getProperty toStringArray getProperty toStringArray getProperty concat getIdpNames put equals toString toString debug
focal_method.modifiers: @NotNull
focal_method.parameters: ()
focal_method.return: Map<String, String[]>
focal_method.signature: Map<String, String[]> getAutoMembership()