LDAPUserGroupCallbackImpl extends AbstractLDAPUserGroupInfo implements UserGroupCallback { @Override public boolean existsUser(String userId) { String context = getConfigProperty(USER_CTX); String filter = getConfigProperty(USER_FILTER); String attributeId = getConfigProperty(USER_ATTR_ID, DEFAULT_USER_ATTR_ID); return existsEntity(userId, 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 testUserExists() { UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.CUSTOM); Assertions.assertThat(ldapUserGroupCallback).isNotNull(); boolean userExists = ldapUserGroupCallback.existsUser("john"); Assertions.assertThat(userExists).isTrue(); }
@Test public void testUserExistsDefaultProperties() { UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.DEFAULT); Assertions.assertThat(ldapUserGroupCallback).isNotNull(); boolean userExists = ldapUserGroupCallback.existsUser("john"); Assertions.assertThat(userExists).isTrue(); }
@Test public void testUserExistsSystemProperties() { UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.SYSTEM); Assertions.assertThat(ldapUserGroupCallback).isNotNull(); boolean userExists = ldapUserGroupCallback.existsUser("john"); Assertions.assertThat(userExists).isTrue(); }
@Test public void testUserExistsWithCommaInDN() { UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.CUSTOM); Assertions.assertThat(ldapUserGroupCallback).isNotNull(); boolean userExists = ldapUserGroupCallback.existsUser("john,jr"); Assertions.assertThat(userExists).isTrue(); }