use of org.kie.api.task.UserGroupCallback in project jbpm by kiegroup.
the class LDAPUserGroupCallbackImplTest method testUserExistsSystemProperties.
@Test
public void testUserExistsSystemProperties() {
UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.SYSTEM);
Assertions.assertThat(ldapUserGroupCallback).isNotNull();
boolean userExists = ldapUserGroupCallback.existsUser("john");
Assertions.assertThat(userExists).isTrue();
}
use of org.kie.api.task.UserGroupCallback in project jbpm by kiegroup.
the class LDAPUserGroupCallbackImplTest method testGroupsSubtreeScopeBaseDnContext.
@Test
public void testGroupsSubtreeScopeBaseDnContext() {
UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallbackWithRoleCtx(SearchScope.SUBTREE_SCOPE, "dc=jbpm,dc=org");
assertGroups(ldapUserGroupCallback, true, true, true, true);
}
use of org.kie.api.task.UserGroupCallback in project jbpm by kiegroup.
the class LDAPUserGroupCallbackImplTest method testGroupsForUserDefaultProperties.
@Test
public void testGroupsForUserDefaultProperties() {
UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallback(Configuration.DEFAULT);
Assertions.assertThat(ldapUserGroupCallback).isNotNull();
List<String> userGroups = ldapUserGroupCallback.getGroupsForUser("john");
Assertions.assertThat(userGroups).hasSize(1);
}
use of org.kie.api.task.UserGroupCallback in project jbpm by kiegroup.
the class LDAPUserGroupCallbackImplTest method testUsersSubtreeScopeEngContext.
@Test
public void testUsersSubtreeScopeEngContext() {
UserGroupCallback ldapUserGroupCallback = createLdapUserGroupCallbackWithUserCtx(SearchScope.SUBTREE_SCOPE, "ou=ENG,ou=People,dc=jbpm,dc=org");
assertUsers(ldapUserGroupCallback, false, false, true, true);
}
use of org.kie.api.task.UserGroupCallback in project jbpm by kiegroup.
the class LDAPUserGroupCallbackImplTest method testInvalidScope.
@Test
public void testInvalidScope() {
Properties properties = createUserGroupCallbackProperties();
properties.setProperty(LDAPUserGroupCallbackImpl.SEARCH_SCOPE, "abc");
UserGroupCallback ldapUserGroupCallback = new LDAPUserGroupCallbackImpl(properties);
assertUsers(ldapUserGroupCallback, true, true, false, false);
assertGroups(ldapUserGroupCallback, true, true, false, false);
}
Aggregations