ExternalPrincipalConfiguration extends ConfigurationBase implements PrincipalConfiguration { @NotNull @Override public PrincipalProvider getPrincipalProvider(Root root, NamePathMapper namePathMapper) { if (dynamicMembershipEnabled()) { UserConfiguration uc = getSecurityProvider().getConfiguration(UserConfiguration.class); return new ExternalGroupPrincipalProvider(root, uc, namePathMapper, syncConfigTracker.getAutoMembership()); } else { return EmptyPrincipalProvider.INSTANCE; } } @SuppressWarnings("UnusedDeclaration")  ExternalPrincipalConfiguration();  ExternalPrincipalConfiguration(SecurityProvider securityProvider); @NotNull @Override PrincipalManager getPrincipalManager(Root root, NamePathMapper namePathMapper); @NotNull @Override PrincipalProvider getPrincipalProvider(Root root, NamePathMapper namePathMapper); @NotNull @Override String getName(); @NotNull @Override RepositoryInitializer getRepositoryInitializer(); @NotNull @Override List<? extends ValidatorProvider> getValidators(@NotNull String workspaceName, @NotNull Set<Principal> principals, @NotNull MoveTracker moveTracker); @NotNull @Override List<ProtectedItemImporter> getProtectedItemImporters(); @NotNull @Override List<ThreeWayConflictHandler> getConflictHandlers();  }
@Test public void testGetPrincipalProvider() { PrincipalProvider pp = externalPrincipalConfiguration.getPrincipalProvider(root, NamePathMapper.DEFAULT); assertNotNull(pp); assertFalse(pp instanceof ExternalGroupPrincipalProvider); }
@Test public void testGetPrincipalProviderEnabled() { enable(); PrincipalProvider pp = externalPrincipalConfiguration.getPrincipalProvider(root, NamePathMapper.DEFAULT); assertNotNull(pp); assertTrue(pp instanceof ExternalGroupPrincipalProvider); }