Search in sources :

Example 6 with UserInfo

use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.

the class LDAPUserInfoImplTest method testGetEmailForEntity.

private void testGetEmailForEntity(OrganizationalEntity entity, String email, boolean customAttribute) {
    Properties properties = createUserInfoProperties();
    if (customAttribute) {
        properties.setProperty(LDAPUserInfoImpl.EMAIL_ATTR_ID, "email");
    }
    if (entity.getId().startsWith("uid=") || entity.getId().startsWith("cn=")) {
        properties.setProperty(LDAPUserInfoImpl.IS_ENTITY_ID_DN, "true");
    }
    UserInfo ldapUserInfo = new LDAPUserInfoImpl(properties);
    Assertions.assertThat(ldapUserInfo.getEmailForEntity(entity)).isEqualTo(email);
}
Also used : UserInfo(org.kie.internal.task.api.UserInfo) Properties(java.util.Properties)

Example 7 with UserInfo

use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.

the class LDAPUserInfoImplTest method testGroupsSubtreeScopeManagerContext.

@Test
public void testGroupsSubtreeScopeManagerContext() {
    UserInfo ldapUserInfo = createLdapUserInfoWithGroupCtx(SUBTREE_SCOPE, "cn=manager,ou=Roles,dc=jbpm,dc=org");
    assertGroups(ldapUserInfo, true, false, false, false);
}
Also used : UserInfo(org.kie.internal.task.api.UserInfo) Test(org.junit.Test)

Example 8 with UserInfo

use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.

the class LDAPUserInfoImplTest method testGroupsObjectScopeRolesContext.

@Test
public void testGroupsObjectScopeRolesContext() {
    UserInfo ldapUserInfo = createLdapUserInfoWithGroupCtx(OBJECT_SCOPE, "ou=Roles,dc=jbpm,dc=org");
    assertGroups(ldapUserInfo, false, false, false, false);
}
Also used : UserInfo(org.kie.internal.task.api.UserInfo) Test(org.junit.Test)

Example 9 with UserInfo

use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.

the class LDAPUserInfoImplTest method testGroupsOneLevelScopeManagerContext.

@Test
public void testGroupsOneLevelScopeManagerContext() {
    UserInfo ldapUserInfo = createLdapUserInfoWithGroupCtx(ONELEVEL_SCOPE, "cn=manager,ou=Roles,dc=jbpm,dc=org");
    assertGroups(ldapUserInfo, false, false, false, false);
}
Also used : UserInfo(org.kie.internal.task.api.UserInfo) Test(org.junit.Test)

Example 10 with UserInfo

use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.

the class LDAPUserInfoImplTest method testUsersSubtreeScopeJohnContext.

@Test
public void testUsersSubtreeScopeJohnContext() {
    UserInfo ldapUserInfo = createLdapUserInfoWithUserCtx(SUBTREE_SCOPE, "uid=john,ou=People,dc=jbpm,dc=org");
    assertUsers(ldapUserInfo, true, false, false, false);
}
Also used : UserInfo(org.kie.internal.task.api.UserInfo) Test(org.junit.Test)

Aggregations

UserInfo (org.kie.internal.task.api.UserInfo)38 Test (org.junit.Test)26 Properties (java.util.Properties)8 OrganizationalEntity (org.kie.api.task.model.OrganizationalEntity)5 Task (org.kie.api.task.model.Task)5 ArrayList (java.util.ArrayList)4 Group (org.kie.api.task.model.Group)4 User (org.kie.api.task.model.User)4 InternalPeopleAssignments (org.kie.internal.task.api.model.InternalPeopleAssignments)4 Iterator (java.util.Iterator)3 List (java.util.List)3 Map (java.util.Map)3 TaskEventSupport (org.jbpm.services.task.events.TaskEventSupport)3 EnvironmentName (org.kie.api.runtime.EnvironmentName)3 TaskContext (org.kie.api.task.TaskContext)3 TaskPersistenceContext (org.kie.internal.task.api.TaskPersistenceContext)3 Assignment (org.kie.internal.task.api.assignment.Assignment)3 AssignmentStrategy (org.kie.internal.task.api.assignment.AssignmentStrategy)3 Notification (org.kie.internal.task.api.model.Notification)3 NotificationEvent (org.kie.internal.task.api.model.NotificationEvent)3