DBUserGroupCallbackImpl extends AbstractUserGroupInfo implements UserGroupCallback { public boolean existsUser(String userId) { if (userId == null) { throw new IllegalArgumentException("UserId cannot be null"); } return checkExistence(this.config.getProperty(PRINCIPAL_QUERY), userId); } DBUserGroupCallbackImpl(boolean activate);  DBUserGroupCallbackImpl(Properties config); boolean existsUser(String userId); boolean existsGroup(String groupId); List<String> getGroupsForUser(String userId); static final String DS_JNDI_NAME; static final String PRINCIPAL_QUERY; static final String USER_ROLES_QUERY; static final String ROLES_QUERY; }
@Test public void testUserExists() { boolean exists = callback.existsUser("john"); assertTrue(exists); }
@Test public void testUserNotExists() { boolean exists = callback.existsUser("mike"); assertFalse(exists); }