LDAPUserGroupCallbackImpl extends AbstractLDAPUserGroupInfo implements UserGroupCallback { @Override public boolean existsGroup(String groupId) { String context = getConfigProperty(ROLE_CTX); String filter = getConfigProperty(ROLE_FILTER); String attributeId = getConfigProperty(ROLE_ATTR_ID, DEFAULT_ROLE_ATTR_ID); return existsEntity(groupId, context, filter, attributeId); } LDAPUserGroupCallbackImpl(boolean activate);  LDAPUserGroupCallbackImpl(Properties config); @Override boolean existsUser(String userId); @Override boolean existsGroup(String groupId); @Override List<String> getGroupsForUser(String userId); static final String USER_CTX; static final String ROLE_CTX; static final String USER_ROLES_CTX; static final String USER_FILTER; static final String ROLE_FILTER; static final String USER_ROLES_FILTER; static final String USER_ATTR_ID; static final String ROLE_ATTR_ID; static final String IS_USER_ID_DN; static final String SEARCH_SCOPE; static final String LDAP_NAME_ESCAPE; }
@Test public void testGroupExists() { UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.CUSTOM); Assertions.assertThat(ldapUserGroupCallback).isNotNull(); boolean groupExists = ldapUserGroupCallback.existsGroup("manager"); Assertions.assertThat(groupExists).isTrue(); }
@Test public void testGroupExistsDefaultProperties() { UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.DEFAULT); Assertions.assertThat(ldapUserGroupCallback).isNotNull(); boolean groupExists = ldapUserGroupCallback.existsGroup("manager"); Assertions.assertThat(groupExists).isTrue(); }
@Test public void testGroupExistsSystemProperties() { UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.SYSTEM); Assertions.assertThat(ldapUserGroupCallback).isNotNull(); boolean groupExists = ldapUserGroupCallback.existsGroup("manager"); Assertions.assertThat(groupExists).isTrue(); }
@Test public void testGroupExistsWithCommaInDN() { UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.CUSTOM); Assertions.assertThat(ldapUserGroupCallback).isNotNull(); boolean groupExists = ldapUserGroupCallback.existsGroup("manager,eng"); Assertions.assertThat(groupExists).isTrue(); }