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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations